World number three Ivanovic struggled throughout with her fellow 20-year-old's deep and powerful hitting.
The Serbian never looked comfortable on the clay surface against her 64th ranked opponent, whom she had struggled to beat in three sets in their only previous meeting, five years ago on the clay in Bucharest.
Ivanovic was particularly out of sorts in the first set and found herself serving at 2-5, 0-40 at one point.
She rallied to save five set points over the next two games but eventually succumbed 6-4 as she made a poor approach shot and was easily passed with a backhand down the line as she was stranded in no man's land.
The Serb went a break up in the second but was broken back and at 3-3 she failed to take any of five more break points.
She finally broke again for 6-5 on a wild error from the Bulgarian and two more errors from Pironkova gave Ivanovic the set in the next game.
But the third set was one-way traffic and Pironkova claimed the biggest win of her career on her second match point.
Her previous best victory was against the then world number 10 Venus Williams at the 2006 Australian Open.
Wimbledon champion Williams had no such difficulties in her second round clash against Australian Samantha Stosur despite seemingly hurting her side.
The seventh seeded American won 6-4, 6-1 and will play Russian Vera Zvonareva, who struggled through 7-5, 4-6, 7-5 against Iveta Benesova, in the third round.
Williams was never seriously in trouble and took total control in the second set, sealing it with an ace.
Read moreAll news
“The world is going too fast to take time over your invoices”We talk with Sarah Roussel, who heads BNP Paribas Factor
Factoring has become all the rage, carried by new services that are popular with very small...
Promoting greater gender equality is a key priority at BNP Paribas. Every year, the Group...