Birmingham head coach Lee Bowyer praised his players for pulling away from danger as they nicked three points in a late 1-0 victory against Rotherham.
City took a huge step towards safety by netting a late winner against their relegation rivals.
Skipper Harlee Dean struck the decisive blow with 88 minutes on the clock as he powered in a header from Marc Roberts' cross.
The defender had been vital at the other end too as he blocked a goal-bound effort from Lewis Wing as Rotherham staged an early second-half siege on the Birmingham goal.
It is a disappointment for Paul Warne's Rotherham, who were playing their fourth game in just eight days. But Derby's faltering form continues to give them hope, with the Millers just four points behind Wayne Rooney's side with two games in hand.
After making it four wins out of six, Birmingham are now nine clear of the Millers, who occupy the final relegation place.
Bowyer said: "It's a big win. I knew it was going to be a tight game with two teams pushing each other and wanting the three points. It was never going to be pretty.
"At this stage of the season, all I care about is winning and getting three points.
"We had the same formations and cancelled one another out. It was about who took the chance when they got it.
"I thought Harlee and all the players were outstanding in both boxes.
"We're not safe until the table says you're safe. We want to get as many points as quickly as we can until we are mathematically safe.
"They have all bought into it. Stopping crosses has been a big part of it. The front lads have been working their socks off and the midfield have been the next barrier.
"They have bought into everything since I came in through the door."
Warne said: "I thought our performance was good. We fundamentally didn't take our chances. If you don't score at this level there's always the chance you will get done.
"I thought we didn't deserve to be on the losing side of that game. If it was in October we would not be feeling as sore about it. We need points and wins and we just came up short.
"We just needed one of them to go in. We limited an in-form Birmingham side to very few opportunities.
"The lads are obviously jaded but they gave everything they possibly could.
"The lads are hugely disappointed. They are still in it, it does make it harder. We play Middlesbrough and if we get a win there, it feels great.
"All the lads are hurting. They will lick their wounds and get ready for another battle."
No Data Analysis info