Craig Bellamy and Mark Hudson struck to send Cardiff City to the top of the Championship with a historic fifth successive home league win.
Peter Whittingham and Mark Hudson combined to give Bellamy the chance to open in the 39th minute.
Leroy Lita punished Hudson's foul to level, hitting home from 10 yards after the free kick.
Home skipper Hudson made amends amid the goalmouth scramble created by Whittingham's well-struck corner.
The Bluebirds have now not lost in 10 league games at the Cardiff City Stadium since Hull's triumphant visit on 13 March, 2012.
And victory on home soil left the Bluebirds celebrating their best home league run at the start of a season in 66 years.
But defeat on a wet night in the Welsh capital means Birmingham continue to search for a second away win of the season.
Bellamy threatened early on, but his effort cleared the crossbar and Craig Noone saw a similar effort miss the mark.
The visitors underlined their threat when Keith Fahey's lofted ball gave Lita a chance to head home, but David Marshall was equal to the challenge.
Lita saw another chance rise harmlessly over the bar from 12 yards as Birmingham's confidence increased.
Such was the visitors' hold on the contest as the opening period went on that Cardiff were unable to earn a clear sight of goal.
Hudson sent an effort wide before of Blues goalkeeper Jack Butland comfortably dealt with Aron Gunnarsson's shot.
But the hosts took the lead when Whittingham found Hudson, who gave Bellamy the chance to open the scoring from 12 yards.
Bellamy went close with a long-range free-kick to leave his side 1-0 ahead at the break.
Lita, on loan from Swansea City, equalised after 54 minutes, putting the final touch to Wade Elliot's cross from close range.
However, Birmingham's best efforts to keep the hosts contained failed as Hudson's poaching instincts came to the fore from Whittingham's cross.
Joe Mason brought the best out of Butland, who executed a wonderful late save from the striker.
And the visiting goalkeeper rescued Birmingham again when Bellamy threatened before his 79th-minute departure.
Birmingham boss Lee Clark told BBC WM:
"We deserved something from this football match, without a shadow of a doubt.
"And anyone who says anything different, I'll tell them the truth.
"We deserved at least a point. We passed it round well and got a deserved equaliser, then them getting back in the game so quick was a blow. We should have dealt with it. We should have come and punched it.
"The performances for the past couple of games have been encouraging. Now we've just got to push on."
Sorry, we were unable to load match stats, please try again.