Rock-bottom Leicester's Barclays Premier League survival bid received a much-needed shot in the arm as a late goal from substitute Andy King steered them to a 2-1 home victory over West Ham.
The Foxes raced into a 12th-minute lead through Esteban Cambiasso's fine strike and were awarded a penalty three minutes later when Carl Jenkinson brought down Leonardo Ulloa, but David Nugent's spot-kick was saved by Adrian.
It looked for a long time as if Nigel Pearson's side would be left regre tting that failed attempt after casual play from them at the back saw West Ham equalise on 32 minutes, Cheikhou Kouyate firing in.
Leicester spurned further decent chances after the break, while Kouyate hit the post at the other end.
But the hosts made off with a vital three points in the end thanks to King's scrappy finish with four minutes of normal time remaining.
The result - Leicester's first win in nine league games and only their fifth of the campaign - saw Pearson's basement boys cut the gap between themselves and safety to four points, with eight more matches to play.
Meanwhile, it was another bad day for West Ham boss Sam Allardyce, his ninth-placed side now having only enjoyed one win in nine league fixtures.
Leicester looked very much up for the challenge in front of them as the game got under way and it was not long before they had the lead.
As the Foxes pressurised, Nugent's prod forward bounced off the back of James Collins to sit up nicely for Cambiasso to crack home from outside the box with a very well-taken first-time shot.
Moments later referee Mark Clattenburg booked Jenkinson and pointed to the spot after the defender fouled Ulloa with a sliding challenge. However, Nugent saw his effort from 12 yards parried by the diving Adrian.
The atmosphere quickly became nervous, with the home side surviving a scramble in the area and Kasper Schmeichel turning a Diafra Sakho strike around the near post.
Riyad Mahrez send the ball looping wide at the other end, but West Ham were getting a grip on proceedings and after Kouyate and Kevin Nolan failed to finish from decent positions, the Hammers drew level.
Leicester allowed their opponents far too much time and space as Alex Song's ball forward drifted into the box, over Jeffrey Schlupp and to Kouyate, who controlled before firing it in.
The hosts struggled to muster much of a response before the interval, but came out for the second half looking positive.
Robert Huth glanced a header wide from a dinked Cambiasso free-kick and Marc Albrighton - on at the break for Mahrez - was just unable to connect on the stretch with a Vardy cross.
Vardy then saw a couple of decent chances go wide, the first a header and the second a shot.
Pearson freshened his attack again by introducing Andrej Kramaric for Ulloa but West Ham were starting to impose themselves once more, with Stewart Downing dragging an effort wide and Kouyate striking the woodwork before bringing a save out of Schmeichel with a curler.
However, Leicester fought back admirably, and after Kramaric had a shot cleared off the line, he sent the ball towards Vardy, whose shot was diverted in from close-range by King for the winning goal.