Birmingham striker Nikola Zigic netted an injury-time winner as Blues defeated Stoke 1-0 in the Premier League at St. Andrew's.
It was no more than Birmingham deserved after dominating possession and it eased their relegation fears.
Blues manager Alex McLeish would have been happy with debutant Obafemi Martins' first game for two months.
The former Newcastle player showed good movement and some neat touches although he had few sights at goal.
But Stoke were as resolute as ever in combating the threat of Martins and Zigic until his late decider.
Birmingham, who achieved back-to-back league wins for the first time in 14 months, were the first to threaten.
Sebastian Larsson sent over a testing centre from the right and Zigic powered his header over the bar.
Stoke keeper Asmir Begovic was called into action for the first time in blocking a header from Liam Ridgewell after Barry Ferguson had headed a cleared free-kick from Larsson back into the box.
Blues keeper Ben Foster, who had recovered from the thumb injury which ruled him out of England's friendly with Denmark, went down to cling onto a deflected drive from Jon Walters.
Stoke enjoyed a spell of possession and John Carew had a shot blocked by Ridgewell inside the box.
Jermaine Pennant, who had a spell on loan at Birmingham earlier in his career, curled a free-kick only a couple of feet past the post after being brought down by Larsson.
Begovic needed two attempts to hold onto a dipping drive from Craig Gardner although Martins was better placed ahead of him inside the box.
Kenwyne Jones took advantage of a mistake by David Bentley and Foster went down at the foot of the post to save.
Birmingham started the second half on the offensive and a 50-yard crossfield ball from Gardner was controlled by Larsson who cut inside before sending a dipping drive just wide.
But at the other end Carew was only just off target with an angled effort.
Blues had a strong appeal for a penalty rejected when Robert Huth appeared to block a fierce drive from Bentley with his hand.
Huth then went down clutching his face even though replays showed the ball had struck his hand.
Birmingham defender Martin Jiranek became the first player to be yellow carded for bringing down Jones.
McLeish brought on Cameron Jerome for Martins with 15 minutes remaining and Tony Pulis replaced Pennant and Jones with Glenn Whelan and Ricardo Fuller.
Jerome teed up Roger Johnson but he dragged his shot wide as Birmingham searched for the winner.
Then in injury-time Zigic headed the winner from close range from a Jerome centre after Begovic had parried Bentley's drive.