Birmingham goalkeeper Ben Foster's embarrassing blunder gave 10-man West Ham a 2-1 win in the League Cup semi-final first leg at Upton Park on Tuesday.
Avram Grant's Hammers were on the rack after Liam Ridgewell's second-half goal cancelled out Mark Noble's first half opener. West Ham then had Nigerian striker Victor Obinna sent off for a petulant kick at Sebastian Larsson.
But Foster made a hash of saving Carlton Cole's weak shot in the closing stages and West Ham have a slender advantage to take to St Andrew's for the second leg on 26 January. West Ham's last piece of major silverware came when John Lyall led the east London club to the 1980 FA Cup and under-fire Grant knew his chances of keeping his job would be greatly increased by a return to Wembley.
Former Blackburn boss Sam Allardyce is reportedly being considered as replacement for Grant, who has struggled to lift West Ham away from the relegation zone since taking over in the close-season. "The spirit was great, we have a small squad and have played a lot of games in a short space of time but the players didn't give up," Grant said. "The first half we had seven or eight chances but couldn't score. The second-half was different - it was difficult with 10 players but our substitutions changed the game."
With so much resting on the result it was odd to see Grant play centre-back Matthew Upson at left-back in a move which underlined the need to sign England defender Wayne Bridge, who watched from the stands ahead of a proposed loan move from Manchester City.
Even with Upson out of position, West Ham had much the better of the first half. The hosts threatened when Freddie Sears fired wide early on, then Foster reacted well to deny Upson, who sneaked into the box after the visitors failed to clear Obinna's overhead kick.
West Ham's pressure paid off in the 13th minute as Noble opened the scoring. Roger Johnson's clearance dropped to Jonathan Spector and his miscued shot was smashed into the net by Noble.
Foster might have been disappointed to be beaten at his near-post, but the former Manchester United goalkeeper redeemed himself by tipping Parker's shot over the bar and then keeping out James Tomkins' close-range header. Obinna then drew another top-class save from Foster when he saw a powerful low drive tipped wide from 15 yards.
Alex McLeish's side suffered another blow when defender Scott Dann was carried off on a stretcher at half-time after suffering a hamstring injury.
After a lacklustre first period, Birmingham were on top after the break and Sears had to clear off the line from Cameron Jerome's header. McLeish's side equalised when Ridgewell took advantage of some slack marking from Winston Reid to score from six yards with a powerful header from Larsson's corner.
Things went from bad to worse for Grant's side when Obinna, waiting to head on Upson's throw, swung his leg backwards straight between the legs of Larsson. The incident was spotted by the linesman and after a brief chat with Dowd, the referee gave Obinna a straight red to leave the Hammers down to 10 with half an hour remaining.
Grant threw caution to the wind in the closing stages as he sent on Cole and fellow striker Zavon Hines. His gamble paid off thanks to Foster's 78th minute howler. Birmingham failed to deal with Spector's low cross, giving Cole the chance to shoot. His tame shot effort was straight at Foster and should have gathered easily. Instead the England international somehow allowed the ball to trickle under his leg into the net.