Struggling Sheffield Wednesday scored twice in the last five minutes at the Britannia Stadium to end Stoke's seven-game unbeaten run.
After Ricardo Fuller had given the Potters a deserved lead, the hosts switched off and found themselves behind thanks to goals from Jermaine Johnson and Marcus Tudgay, before Fuller restored parity four minutes before the break.
The game looked to be heading for a draw - which would have been a fair result - until Tudgay headed in his second and Deon Burton's deflected shot ensured three valuable points for Brian Laws' side.
Former Potter Graham Kavanagh, on loan at Wednesday, was booed throughout and failed to silence the Boothen End faithful inside the opening 10 minutes with two shots wide of the mark.
Stoke took the lead in the 12th minute when a long ball over the top found the Owls' defence at sea and Fuller capitalised, selling his marker a dummy before slotting calmly home.
Four minutes later Wednesday were level though, the Stoke defence standing still and allowing Johnson to drift in from the right before checking onto his left foot and firing in from a tight angle.
In the 23rd minute Wednesday's front pair combined well to give them a deserved lead. Francis Jeffers played in Tudgay, who hit the post, but the ball was not cleared and Jeffers crossed back in for an unmarked Tudgay to head home.
Jeffers and Tudgay's promising partnership was cut short when a bad tackle by Ryan Shawcross saw the former Arsenal striker carried off to be replaced by Burton.
But there was still life left in the half as Fuller completed his brace after another defensive error.
Richard Wood foolishly tried a back-pass from 40 yards out and Fuller muscled in ahead of his marker to head over the advancing Lee Grant.
Whatever Stoke boss Tony Pulis said to his side at the break, it failed to improve the concentration of the defence as just two minutes after the restart Burton picked up where Jeffers had left off, feeding Tudgay, but he blazed over.
And Wednesday looked to have paid for that profligacy in the 51st minute when John Eustace found the net with a sweet strike from 30 yards.
Unlike their hosts, Wednesday had improved on their earlier defensive frailties and were restricting Stoke to half-chances, such as Peter Sweeney's shot from the edge of the area which flew straight into the arms of Grant.
In the 73rd minute a quickly-taken throw found Fuller on the right, he ghosted into the area and beat his man before cutting back to Richard Cresswell, who tried to back-heel the ball into the net but was thwarted by an alert Grant.
The game looked like it had a fifth goal in it and, in the final 10 minutes Stoke looked the more likely to get it, Sweeney's wickedly bouncing shot in the 81st minute held safely by Grant.
But with five minutes to go Wednesday won a corner on the right, Kavanagh swung it in and Tudgay headed the ball downwards and past a flailing Steve Simonsen.
Two minutes later the Owls fans were celebrating after Burton's strike took a huge deflection of a defender's boot to deceive Simonsen and nestle into the bottom corner.
Teams
Stoke Simonsen, Zakuani, Shawcross, Wilkinson, Lawrence,Delap, Eustace, Matteo, Cresswell, Parkin (Sweeney 63), Fuller.
Subs Not Used: Hoult, Buxton, Dickinson, Phillips.
Booked: Shawcross, Cresswell, Matteo.
Goals: Fuller 12, 41.
Sheff Wed Grant, Bullen (Hinds 46), Wood, Michael Johnson,Spurr, Jermaine Johnson (Sodje 88), Kavanagh, Whelan, O'Brien,Tudgay, Jeffers (Burton 34).
Subs Not Used: Lunt, Esajas.
Booked: Burton.
Goals: Jermaine Johnson 16, Tudgay 23, 85, Burton 87.
Att: 14,019
Ref: Lee Mason (Lancashire).