Substitute Nathan Lowe ended Stoke's five-game winless Championship run with a dramatic last-minute winner to compete their fightback from 2-0 down at Bristol City.
Lowe met a cross from Bae Junho to tap home his first goal in senior football and earn the Potters a hard-fought and much-needed three points at Ashton Gate.
Sam Bell had given the hosts the ideal start with a fine near-post finish after Stoke failed to deal with the first corner of the game.
Nahki Wells punished Stoke for a poor back pass to make it two soon after, only for Algeria international Mehdi Leris to pull one back with an excellent effort that found the top corner.