Middlesbrough moved into third spot in the Championship after staging a second-half comeback against Birmingham, who have slipped to 18th.
The Blues have now lost six consecutive away games but took the lead from an Adam Rooney penalty, after the striker was brought down by keeper Carl Ikeme.
Boro hit back after the break through Barry Robson and Faris Haroun.
And midfielder Malaury Martin came off the bench to secure the points for Tony Mowbray's side.
It was Boro's third consecutive victory as they maintained their impressive start to the season.
But Mowbray will be disappointed with the manner of Birmingham's goal, which came against the run of play.
Tony McMahon had already struck the post for Boro when Birmingham's lively winger Chris Burke was judged to have been felled in the area by Ikeme on 36 minutes.
Rooney fired the penalty into the bottom corner to give the Blues the half-time lead.
But that advantage lasted just three second-half minutes before Robson's free-kick crept in off the post to level the scores.
Chris Hughton's side still threatened and Rooney could have regained the lead before Middlesbrough sealed victory with two goals in three minutes.
Substitute Haroun made it 2-1 from 12 yards before Martin, who had joined the action on 67 minutes, wrapped up victory with a majestic 25-yard finish.