
Famara Diedhiou's goal was his fifth of the season for Bristol City
Famara Diedhiou scored the only goal of the game as Bristol City became the first side to win a league game at Birmingham City since March.
Striker Diedhiou - who served a six-game ban last season after being found guilty of spitting during a game against Birmingham in April - headed home a second-half corner by sub Callum O'Dowda to break the deadlock at St Andrew's.
The Robins had gone close early on when centre-back Tomas Kalas had a shot blocked on the line.
Lukas Jutkiewicz had Birmingham's best effort, but his header from Connor Mahoney's free-kick struck the post.
Blues remain ninth despite the defeat, their first in 16 Championship games at home, with the visitors moving to 13th following their fifth away victory of the campaign.
They had the best early opportunity when Kalas had an effort blocked on the line.
Jacques Maghoma responded for Birmingham with a surging run into the box, but the referee waved away penalty appeals after he went down under a challenge.
Robins keeper Niki Maenpaa saved from Che Adams moments before Diedhiou found the net and he was there again in the final moments to keep out Kristian Pedersen's free-kick.
Birmingham City manager Garry Monk told BBC WM 95.6:
"I said before the game that is the type of game that will be decided by margins and unfortunately it was for us today.
"In terms of the margins of the actual game, their one goes in, our one hits the post.
"In terms of decisions, quite a few penalty decisions went against us today and we finished on the wrong end of the result."
Bristol City head coach Lee Johnson told BBC Radio Bristol:
"It's a big achievement [to win at Birmingham] - they've got it going and they're a tough team to beat. But now we're a point behind them, we're looking up.
"It was a dogged performance, a victory that was very hard fought and deserved.
"We've worked hard this week on getting across people in the box and delighted for Famara to get the winner after what was a difficult start to the season due to Birmingham's complaints, we feel unjustly, in the spitting incident."