Latvian 19-year-old Ostapenko came from a set down to triumph 5-7 6-3 7-6 (7/5) against the Danish former world number one in two hours and 46 minutes.
Ostapenko will now face Ana Konjuh of Croatia, who beat Czech Marketa Vondrousova 6-4 7-6 (7/2).
There were also exits on Wednesday for fourth seed Sam Stosur and fifth seed Lucie Safarova, the runner-up and champion last year respectively, the former being defeated by Beatriz Haddad Maia and the latter having to withdraw from the tournament prior to her scheduled round two match against Kristyna Pliskova because of illness.
Haddad Maia and Pliskova will now face each other.
Third seed Barbora Strycova did make it through by seeing off Lucie Hradecka and now faces eighth seed Katerina Siniakova, who got the better of Natalia Vikhlyantseva. Mona Barthel and Camila Giorgi also progressed to set up a quarter-final meeting.
At the Grand Prix de SAR La Princesse Lalla Meryem in Rabat, Morocco, top seed Anastasia Pavlyuchenkova advanced into the quarter-finals by overcoming fellow Russian Ekaterina Makarova, but second seed Timea Bacsinszky was ousted.
Switzerland's Bacsinszky, the defending champion, was beaten in three sets by American Cici Bellis.
Fifth seed Yulia Putintseva and eighth-seeded Alison Riske were also eliminated, falling to defeats to Varvara Lepchenko and Sara Errani, but other seeds did make safe passage in Daria Gavrilova (third) and Lauren Davis (seventh).
Read the original article on Eurosport: Jelena Ostapenko hands down another defeat to Caroline Wozniacki