It was third time lucky for West Ham United as they finally got back to winning ways at Upton Park.

Following disappointing and dismal defeats at the hands of Tottenham Hotspur and Southampton they took early control before surviving a nervous second half to secure a richly-deserved victory over Liverpool.

Certainly, the Hammers could not have asked for a better start to this tea-time kick-off, as Winston Reid and then Diafra Sakho sent the East Enders into a quick-fire two-goal lead inside the opening seven minutes.

And although Raheem Sterling pulled one back as the half-hour mark approached, West Ham survived a second half of Reds pressure before Morgan Amalfitano sealed that wonderful win, three minutes from time.

Following his side’s wholesome 2-2 draw at Hull City on Monday night, Sam Allardyce made just one switch, giving on-loan Barcelona midfielder, Alex Song his first start as Mauro Zarate was unluckily relegated to the substitute’s bench.

The Reds had bagged a late, late win over battling Bulgarian champions, Ludogorets at Anfield on Tuesday evening and, following that victory, Brendan Rodgers made a trio of changes as Fabio Borini, Martin Skrtel and Lucas Leiva replaced Philippe Coutinho plus substitutes Adam Lallana and Mamadou Sakho.

Kicking off two points adrift of Liverpool with four games played, the Hammers got off to an absolute flyer as they took an incredible two-goal lead that would ultimately send them above the Merseysiders in the table.

Indeed, with just over a minute on the clock, Stewart Downing was upended out on the right flank and, after dusting himself down, the former Anfield flyer whipped over a deep free-kick that James Tomkins nodded back across goal, where Reid bundled the ball home with the help off a deflection off Dejan Lovren on the line.

It was proving to be an eventful start for Reid, who was then booked for bundling Borini shortly before West Ham then doubled their advantage.

This time, Mark Noble foraged his way through the shell-shocked Reds’ midfield before spreading an angled pass out to Sakho on the right flank and the Hammers striker sent Upton Park wild once more, when - with precision and pace - he floated the ball over both Simon Mignolet and the in-rushing Enner Valencia, who did not need to apply any finishing touches to his strike-partner’s effort.

Already two goals adrift inside those opening seven minutes, it could have got yet worse for Liverpool, as Aaron Cresswell sent in an awkward 20-yarder that skidded off the wet Boleyn Ground grass before Mignolet palmed the ball aside for a corner.

And after Downing tested the visiting keeper from similar range, too, the Merseysiders only threat in the Hammers area came in the form of Mario Balotelli’s tussle with Adrian that saw both the Italian and Spaniard booked, before referee Craig Pawson awarded the free-kick to West Ham.

Midway through the half, Liverpool left-back Javier Manquillo was removed for his own protection by Rodgers, who pitched his own Sakho - Mamadou - into the fray.

That switch soon helped to steady the Reds ship, and a move down the left saw the ball worked into the West Ham area, where Balotelli drove a 26th-minute shot straight at the courageous

Cresswell and that allowed Sterling stroll onto the rebound and lash an unstoppable 18-yarder beyond the diving Adrian.

Despite seeing their lead halved, West Ham’s heads were still being held high and they went on to finish the half in fine fettle.

Cheikhou Kouyate was the third Hammer to be yellow-carded for an over-zealous slide into Alberto Moreno after Sakho dangerously back-heeled into the six-yard box and, after Lovren received lengthy treatment for a nasty-looking neck injury, only two fine stops by Mignolet prevented Valencia from giving the Hammers an even greater half-time cushion.

Lallana replaced Lucas for the restart and Liverpool certainly looked a different team as Borini forced Adrian to save his low, angled shot at the base of his left-hand post, while Balotelli also curled one into the keeper’s clutches.

With Liverpool clearly in the ascendancy, Lallana bent another effort over the angle before Carl Jenkinson stepped from the bench to replace Guy Demel, on the hour.

The on-loan Arsenal defender was soon booked for mauling Moreno and, after Borini had another skidding effort beaten out by Adrian, Amalfitano came on for the tiring Song.

Valencia offered token resistance with a chip that just cleared Mignolet’s crossbar but all eyes were, by now, on the busy Adrian, who clawed out another Balotelli belter.

With a quarter-hour remaining, Rodgers upped the ante with a final throw of the dice as Rickie Lambert came on for Borini, while Big Sam matched that one with the introduction of James Collins at the expense of Valencia, who retired to a rapturous reception.

Sakho had a close-range header saved but just as it looked like Liverpool were all set to steal a point, the newly-arrived Amalfitano took the wind totally out of their sails, when he strolled onto Downing’s well-weighted forward pass to cement a hard-earned victory with an angled 15-yarder that flew beyond Mignolet as Skrtel fruitlessly slid in

HAMMERS: Adrian, Demel (Jenkinson 61), Cresswell, Reid, Tomkins, Noble, Kouyate, Song (Amalfitano 68), Downing, Sakho, Valencia (Collins 75). Unused subs: Jaaskelainen, Zarate, Vaz Te, Cole.

REDS: Mignolet, Moreno, Manquillo (Sakho 22), Lovren, Skrtel, Gerrard, Lucas (Lallana h/t), Henderson, Borini (Lambert 75), Sterling, Balotelli. Unused subs: Jones, Enrique, Toure, Markovic.

Referee: Craig Pawson

Bookings: Reid (4), Adrian (17), Balotelli (17), Kouyate (28), Jenkinson (66)

Attendance: 34,977.