As men's champion Novak Djokovic reached the quarter-finals with his 28th straight win since September, another Serb rubbed out the hot women's favourite and ended one of the longest streaks of her career.
In a result which throws the women's draw wide open, Ivanovic capitalised on Williams' poor movement to take her first ever sets against the world number one, winning 4-6, 6-3, 6-3.
Afterwards, Williams said she was on strong medication for a back injury which she suffered in recent days and almost prompted her to pull out before her third-round win over Daniela Hantuchova.
"I think Ana just played a really good match. She did what it takes to win."
Also Read
The upset robs Williams of the chance to join Chris Evert and Martina Navratilova on 18 Grand Slams, and draw nearer to Steffi Graf's Open-era record of 22.
Williams' coach, Patrick Mouratoglou, had said she was capable of winning all four Grand Slam titles this year -- a feat not achieved since Graf's sweep in 1988.
Her departure is a giant opportunity for those left in the draw, including Ivanovic, defending champion Victoria Azarenka and Li Na, who beat Ekaterina Makarova to reach the last eight.
Williams was on a 25-match winning streak, the second best of her career, after one of her most successful seasons in 2013 when she won a career-high 11 titles, including the French Open and US Open.