Foster, whose recent form has been eye-catching, insisted lesser sides would have lost by a hatful. But the Blues hung on and could even have nicked a point had Seb Larsson not blasted over a late chance.

NEWCASTLE 2 -- BIRMINGHAM 1

“Our team spirit showed what we’re all about,” said Foster. “We have ground out results and we have been together as a unit all season.

“This game all hinged on the penalty decision. Newcastle started pretty fast and we gave it a real go, but the sending-off and the penalty turned the game on its head.

“It was pretty harsh to red-card him. Ridgewell saw Kevin Nolan wind up and he was just trying to protect himself. Unfortunately, the ball hit his arm and the ref sent him off.

“We have been resilient the whole season. We’re very good at keeping it tight, having two banks of four and then trying to hit teams on the counter-attack or from set-pieces.

“The next game against Fulham is a massive match. If we get three points from it that is us safe and we can look forward to next season.

“There is no doom and gloom around the club as we have one game to put everything right. Confidence is fine. We have had tough games and some bad results but we should be OK. We’re not looking to get a draw next week. We’re looking for the three points to make sure.”

Foster rebuffed everything Newcastle could throw at him until the 36th minute when he produced an incredible double save to deny Shola Ameobi and Fabricio Coloccini. But referee Chris Foy adjudged Ridgewell had handled, allowing Ameobi to score from the penalty spot.

Steven Taylor scored his first goal for 18 months two minutes before half-time with a soaring header, before Lee Bowyer halved the deficit following comical Coloccini defending.

In the second half Newcastle enjoyed chance after chance only to be thwarted by Foster and the towering Roger Johnson. With minutes to go Tim Krul dropped a cross and Larsson should have scored, but the Magpies deserved the three points, which keeps them above North-east neighbours Sunderland on goal difference.

Defender Danny Simpson said: “It was a relief. None of us thought we were going to go down, but to be safe is a relief.

“Our home form has been turned around. At the start of the season it was poor, but that is no longer the case and it has come at the right time.

“After last week at Liverpool we were so disappointed. It was the way we were beaten. A few things were said afterwards because the season wasn’t over. The staff and the players got together and we knew how important this match was.

“We want to push on even more and get up the table. As a player, you want others to come in as competition is healthy.

“The basis is there for next season. We’ve a great bunch of lads who want to work hard and to win. The manager will want to bring in players who will work just as hard and add that little bit of extra quality.”

Newcastle are safe, Birmingham not quite. But defeats can be defining and McLeish’s side showed just why they will probably stay up.

And how about this for a bizarre statistic: the Blues have won eight games in the league this season but 10 in cup competitions – including that memorable Wembley success.