West Ham eased the pressure on manager Slaven Bilic with their first Premier League win of the season as they beat Huddersfield 2-0.
A deflection saw Pedro Obiang's shot creep in off the post 18 minutes from the end before Andre Ayew made sure of the victory soon after.
For a long time it seemed as though West Ham's dominance would not be enough as they spurned a number of good opportunities.
Their perseverance paid off, however, as their first points of the campaign lifted them two places to 18th and condemned Huddersfield to their first defeat.
West Ham should have gone ahead little more than a minute in when Andy Carroll crossed low across the face of goal but Cheikhou Kouyate was fractionally late as he tried to slide in.
Javier Hernandez went closer moments later as the hosts made the brighter start but after Michail Antonio's cross, the Mexican saw his shot come off the face of the crossbar via Tommy Smith.
Huddersfield took time to settle and although they started seeing more of the ball, it was West Ham who had the better chances and James Collins' header was smothered by Jonas Lossl.
For all the danger they posed coming forward, West Ham lacked an edge and Antonio's 20-yard drive deflected over rather than in before Kouyate missed the target when he should have scored.
Aaron Cresswell's free-kick over the upright before the break was poor, with Hernandez's after just as wasteful as frustration began to creep in.
Huddersfield's openings were rare but Philip Billing tested Joe Hart with a ferocious low drive which needed the England goalkeeper to react quickly to keep it out.
Just as they seemed to be stretching West Ham, they almost shot themselves in the foot as Zanka sliced an attempted clearance just wide of his own goal.
Yet it said much about this game that the home side could not make them pay from the corner and when they finally took the lead 18 minutes from the end, it was with a huge slice of luck.
Obiang was credited with the goal but the fact his shot came off Zanka's back before wrong-footing Lossl and going in off the post meant it would be bold of him to claim it.
Buoyed by that, West Ham doubled their advantage six minutes later when Jose Fonte's header wasn't cleared and substitute Ayew poked in the rebound.
Tom Ince hit the bar in the closing stages but West Ham saw out a scrappy victory - not that Bilic will be caring how it was achieved.
Opta stats
- Huddersfield are the last team in this season's Premier League to concede a goal, after 342 minutes of action
- Andre Ayew has been directly involved in four goals in his last five Premier League games (a goal and assist v Huddersfield and a goal and assist v Burnley last May).
- Andy Carroll won 13 aerial duels in the game, the most of any player in a Premier League game this season.
- Joe Hart registered a clean sheet for the first time in his last 23 league games.
The managers
Slaven Bilic: "It was a must-win game and I was pleased with the way we played. It was a top performance and we totally deserved it. We kept calm and changed the shape a little and said we were going to get back to basics. It's my birthday and this is a great present."
David Wagner: "We were not good enough. It was a deserved result. We were second best in more or less every area. I am unsure if we were nervous. Today we looked like a promoted team with some nerves, especially with the ball. We made so many unforced errors."
The pundit
Sam Allardyce: "That has taken the pressure off Slaven. He has got the three points on the board and can push on and the players who come back will strengthen the squad. They can be a force going forward and have lots of goals in the team, it's just about being solid at the back and getting clean sheets. Slaven's got his just rewards, as lucky as it was. That didn't matter - it was all about the result and I thought his tactics were spot on."
Man of the match - Michail Antonio
The winger was a threat all night in a lively three-pronged West Ham attack alongside Javier Hernandez and Andy Carroll. He showed tremendous pace to set up Carroll early on as the former Liverpool forward hit the bar and his quick feet caused all sorts of problems for the visitors, with Zanka booked for a crude challenge on the 27-year-old. Although Antonio wasn't directly involved in either of the goals, you would expect he will set up plenty in the months ahead.
What's next?
After a month away from the London Stadium, West Ham are back on the road again as they visit West Brom on Saturday. Huddersfield are at home, however, as they face 2015/16 champions Leicester at the John Smith's Stadium.