West Ham left it late before securing their place in the FA Cup fourth round after won 1-0 at National League side Stockport County.
Craig Dawson’s late header secured a hard-fought victory for David Moyes’ men in tough conditions on a difficult pitch.
The London side will now face Doncaster in round four, with a potential tie against Manchester United or Liverpool in the fifth round.
Hammers boss David Moyes named a strong line-up to take on Stockport in the third-round clash.
Moyes made five changes to the side that beat Everton in the Premier League on New Year’s Day, with Ben Johnson, Mark Noble, Andriy Yarmolenko, Manuel Lanzini and Michail Antonio all drafted in.
However, it is a team comprising of seven full internationals against a non-league side that has reached this stage of the competition for the first time since 2007.
The Hatters’ line-up contained Wayne Rooney’s younger brother John.
Conditions at Edgeley Park were tricky for both sides in the driving rain, which had been falling for many hours on Monday, but West Ham came close when Said Benrahma chested down a cross and curled narrowly wide.
Ben Hinchliffe had helplessly watched that effort drift just past his left-hand post but flung himself across the greasy turf when Andriy Yarmolenko cut in from the right and directed a left-foot shot wide from distance.
Play was momentarily halted after a quarter of an hour due to a prolonged – and loud – fireworks display just outside the ground.
Stockport were doing more than just hanging in but it was West Ham who were much more threatening and Yarmolenko’s precision pass almost put Antonio through but the forward got the ball tangled between his legs.
Lanzini struck from the edge of the box and Hinchcliffe gathered at the second attempt at his near post after the ball initially bobbled out of his grasp.
Mark Kitching’s last-ditch challenge stopped Antonio as he was winding up to shoot after being put through while the forward’s deflected effort just missed the target as the Hammers were once again denied the opener.
The teams went in at half-time goalless.
Tough going for Hammers
West Ham wanted a penalty just before the hour mark when Declan Rice drove into the box, the ball popped up and hit a Stockport player’s arm but ref Mike Dean was having none of it.
The home side went close themselves five minutes later when Connor Jennings’ cross-shot was cleared away by Craig Dawson.
Moyes turned to Tomas Soucek and Jarrod Bowen off the bench with just over 20 minutes to go, with Manuel Lanzini and Andriy Yarmolenko going off.
The visitors finally broke the deadlock with seven minutes to go, when a short corner was played to Jarrod Bowen whose cross was met by a powerful header from Dawson.
Stockport piled forward in search of an equaliser but came up short as the Hammers progressed.