Aston Villa's hopes of Premier League survival received a major boost as two quick-fire goals saw off West Ham and moved them out of the bottom three.
After a poor first half, the hosts went ahead through Christian Benteke's penalty after Mark Noble clumsily fouled Charles N'Zogbia.
Simon BrothertonMatch of the Day commentator
"A massive win for Aston Villa. Only their third win at home all season. And a win that carries them out of the relegation zone. But, boy, did they make hard work of it. West Ham pushed them all the way to the final whistle."
N'Zogbia doubled the lead moments later, curling in a 20-yard free-kick.
Ashley Westwood's late own goal set up a tense finale, but the hosts held on to the relief of the Villa Park crowd.
It meant £18m club record signing Darren Bent, who had only played 79 minutes of Premier League football since November, was again left on the bench.
Villa, who had only scored twice in their previous seven home Premier League games, would have been in front inside two minutes but for an horrendous miss by Andreas Weimann.
Benteke cut in from the left wing and saw a powerful shot parried by Hammers goalkeeper Jussi Jaaskelainen. The ball fell to the unmarked Weimann six yards out but the Austrian, who made his first start for his national side in the week, pushed his effort beyond the far post.
Consecutive seasons in the top-tier of English football
87 - Arsenal
59 - Everton
51 - Liverpool
38 - Manchester United
35 - Tottenham
25 - Aston Villa
24 - Chelsea
For a long time, it looked as though Weimann's miss could prove costly as West Ham upped the tempo in the second-half and posed a greater attacking threat.
Ciaran Clark and Ron Vlaar blocked goal-bound chances, before Lambert replaced the ineffective Bowery with Bent, who was immediately involved in the action.
It was not, however, in the manner expected as the Villa striker cleared Andy Carroll's attempt off the goal-line with his first touch of the match.
The hosts finally took hold of an ugly game when N'Zogbia was adjudged to have been fouled in the area by Noble.
Benteke kept his composure to send Jaaskelainen the wrong way with the spot-kick for his 15th goal of the season, and the home fans had barely stopped celebrating before Villa doubled their lead, N'Zogbia curling a wonderful free-kick into the top corner.
Aston Villa scored as many goals in this game as in their previous seven Premier League matches at Villa Park.
This page is best viewed in an up-to-date web browser with style sheets (CSS) enabled. While you will be able to view the content of this page in your current browser, you will not be able to get the full visual experience. Please consider upgrading your browser software or enabling style sheets (CSS) if you are able to do so.