Tomas Soucek’s persistence paid off as his late header secured a 3-2 win for West Ham against Nottingham Forest.
In the closing stages, the Czech midfielder hit the crossbar and had a header miraculously saved by Forest keeper Odysseas Vlachodimos.
But Soucek made it third time lucky when he nodded home James Ward-Prowse’s corner to finally see off the visitors.
Goals from Taiwo Awoniyi and Anthony Elanga had put Forest into the lead after Lucas Paqueta fired the Hammers ahead in the third minute.
But Jarrod Bowen’s eighth Premier League goal of the season hauled West Ham level before Soucek’s late heroics.
Paqueta struck after Nicolas Dominguez’s stray pass across the pitch cannoned off Ibrahim Sangare’s backside.
The Brazilian still had plenty to do but his low, accurate finish from the edge of the area comfortably beat the dive of Vlachodimos.
Forest were denied an equaliser by a stunning save from Alphonse Areola, who got a powerful hand on a point-blank header from Awoniyi.
Moments later Mohammed Kudus led a counter-attack and squared the ball for Paqueta, only this time his control let him down and his tame shot was straight at Vlachodimos.
But Forest gradually regained their shape and set about frustrating West Ham, who seemed to rapidly run out of ideas.
The crowd began to get restless as sideways pass after sideways pass came to nothing.
Even Forest got bored of it eventually, and they hauled themselves level on the stroke of half-time when Sangare won the ball in a congested midfield.
Sangare, with probably the first forward pass of the match from either side, played Morgan Gibbs-White through on goal.
Gibbs-White’s angled drive was kept out by Areola but Awoniyi was on hand to tap the rebound into and empty net.
West Ham came out with more impetus after the break and Kudus had a shot deflected over before Emerson Palmieri fired narrowly wide.
Forest should have gone ahead when Awoniyi played a one-two with Elanga only to slice his shot way off target.
Instead they got their noses in front just after the hour when Elanga tucked in a low cross from Ola Aina.
But West Ham hit back immediately, Bowen meeting Ward-Prowse’s corner with a powerful header past Vlachodimos.
Then Soucek took centre stage, first lifting the ball over Vlachodimos only to see it come back off the crossbar before the Greek keeper somehow tipped his downward header over the top.
But Soucek struck with two minutes remaining, leaping over team-mate Bowen to meet another Ward-Prowse corner at the far post to seal West Ham’s first Premier League win since September.