West Ham produced arguably their best display of the season to haul themselves back off the bottom of the Premier League and all but end Liverpool's faint Champions League hopes.

Goals from Scott Parker, Demba Ba - rapidly developing into one of the signings of the January transfer window - and Carlton Cole secured a 3-1 win at Upton Park and kept the pressure on the Hammers' relegation rivals.

Glen Johnson pulled one back for Liverpool but their late rally was in vain as their revival under Kenny Dalglish suffered its first major setback.

The defeat left the Reds eight points behind fourth-placed Tottenham having played a game more, while Avram Grant was able to celebrate a result that moved the Hammers level on points with fourth-bottom Wolves.

The hosts certainly did not lack for confidence in the opening moments, Thomas Hitzlsperger - making his Premier League debut for the club - unleashing an outrageous 40-yard volley that flew into the arms of Jose Reina.

A minute later, Raul Meireles looped a header wide from the fit-again Steven Gerrard's pinpoint 50-yard ball before Martin Skrtel was booked for tripping Frederic Piquionne in full flight.

Meireles also fired straight at Robert Green, Gary O'Neil's shot hit a Liverpool defender and Glen Johnson saw a header from a corner blocked before the game settled down.

A Hitzlsperger rocket was again too close to Reina before Parker showed the kind of precision his team-mate had been lacking to give West Ham a 22nd-minute lead.

He and Hitzlsperger played a neat one-two on the edge of the box and Parker floated a delightful finish right into the far corner with the outside of his foot.

Dirk Kuyt hit the side netting from 20 yards following a lightning Liverpool break when team-mates were arguably better placed.

The recalled Piquionne then sent a wicked ball across the six-yard box, which just evaded Ba.

Liverpool struggled to respond, Luis Suarez repeatedly coming off second best in his personal battle with the impressive James Tomkins.

Right-back Martin Kelly's low drive was too close to Green as the interval approached, while Mark Noble curled a free-kick wide at the other end.

Liverpool suffered another blow when Kelly pulled a hamstring and was replaced by Joe Cole, Dalglish switching his formation from 5-3-2 to 4-4-2.

That was not the end of their woes, with the unmarked Ba powering home a header on the stroke of half-time from O'Neil's cross.

Liverpool began the second half on top but nevertheless made a quick change when David Ngog came on for Meireles.

With Wolves having won 4-0 yesterday, West Ham needed another goal to climb out of the drop zone and Ba almost provided it when he drilled inches wide from 25 yards.

Tomkins, Piquionne and Ba were all close to connecting with a corner as the home side hit back.

But they had Green to thank for preserving their two-goal lead when Suarez finally beat Tomkins with a quick turn and unleashed a rising drive which the goalkeeper tipped behind.

Piquionne missed a glorious chance to kill the game when he glanced Noble's corner wide midway through the half but West Ham's commitment was summed up when Parker threw himself in front of a goalbound Gerrard shot.

Gerrard was making his presence felt and Green tipped a dipping volley over the bar from the England star.

Reina had to be equally alert to beat Ba to the ball from a Hammers break but he almost produced an absolute howler when he spilt Piquionne's shot goalwards before recovering.

It was all Liverpool at this stage and Grant responded by withdrawing Piquionne for Jonathan Spector after Cole had mishit a volley for the visitors.

But the Reds' pressure paid off six minutes from time when Suarez crossed for Johnson to tap into an unguarded net.

West Ham ran down the clock by bringing on Cole for Ba - although time-wasting was the last thing on the substitute's mind as he left Skrtel in a heap and drilled home at Reina's near post in stoppage-time.

There was still time for Suarez to test Green again but the points had already been lost.