Andy Carroll scored his first goal since April as West Ham earned a place in the FA Cup fourth round with a win over Birmingham.
The Hammers striker, who made his first start in a year on Wednesday, came on as a 19th-minute substitute for injured goalscorer Marko Arnautovic.
But his injury-time header sealed the win after an open game where Birmingham wasted several chances to level.
Arnautovic headed in after two minutes before he was replaced.
The Austrian striker, who is now West Ham’s joint top scorer with nine goals, appeared to share a disagreement with boss Manuel Pellegrini when he left the field, and did not seem too distressed by the injury.
Pellegrini later said he wanted to avoid “a risk” after the 29-year-old had complained of a “pain in his back”.
But the Chilean manager will be buoyed by Carroll’s return to scoring form, following an ankle injury, despite him appearing to lack sharpness, including a late miss before his goal.
There was also a positive return to action for debutant Samir Nasri, who took control early on before he was replaced by Robert Snodgrass in the 58th minute.
Carroll makes it count in the end
Birmingham, who are eighth in the Championship and four points off the play-off positions, will rue several chances to get themselves back into the game.
Blues striker Lukas Jutkiewicz was guilty of a hat-trick of misses, while full-back Wes Harding’s touch let him down when he was clean through on goal from an angle.
Both Pellegrini and Birmingham boss Garry Monk named strong line-ups which contributed to a robust and open encounter where Carroll was involved in several physical exchanges with the Birmingham defence.
The hosts’ superior squad depth counted as Snodgrass’ extra energy appeared to turn the game in West Ham’s favour in a second half where Birmingham looked like they would score.
Felipe Anderson was also introduced to give added threat and there were positive contributions from midfielders Grady Diangana and Michail Antonio.
But the last hurrah was left to Carroll, who had already shown his worth by clearing one Jutkiewicz effort off his own goalline.
The 29-year-old would have also been pleased to make up for a bad miss as injury-time approached when he miscontrolled an attempt to take the ball around goalkeeper Lee Camp.
Earlier he also hit the bar, so when the goal came via a trademark header from Antonio’s cross, Carroll celebrated with relief following an ankle injury that had kept him out until the start of December.
Pellegrini ‘thinks’ Carroll and Arnautovic will stay – reaction
West Ham boss Manuel Pellegrini: “Andy has had a good career behind him. When he’s playing there is always something happening around him. He’s coming from a long injury and I think in the second part of season he will contribute to the team.”
On the disagreement with Marko Arnautovic: “He felt a pain in his back at the beginning. He wanted to continue after that, but it was not good to take a risk. He played 90 minutes on Wednesday, the previous game 65 minutes, so it was important for him to be replaced.”
On whether Arnautovic and Carroll would be at West Ham at the end of the transfer window: “I don’t know what will happen but I think both players will stay here.”
Birmingham manager Garry Monk: “That was our fifth game in 14 days, but we competed so well today. It was difficult circumstances, but we had our chances, we just didn’t have that cutting edge that we needed and you have to take your chances when you come to places like this.
“Credit to West Ham, they are a quality team but we wanted to show we can compete against a team a league above us and we did. So we are very proud of our players.”