Leon Bailey scored a late winner as Aston Villa condemned Leicester to a fifth straight Premier League defeat.
The Jamaica forward made a late run into the box to tap home substitute Ian Maatsen's low cross in the 78th minute for his first goal of the season.
It had looked like Ruud van Nistelrooy's visitors would end their losing run after Stephy Mavididi equalised Villa's opener in the 64th minute, finishing a rebound after Emiliano Martinez's fine save from a close-range Jamie Vardy shot.
Unai Emery's Villa led after a sumptuous 58th-minute strike from Ross Barkley from the edge of the box for his third league goal of the campaign.
At 2-1, Bailey came within inches of wrapping up the points after his driving run ended in a strike that rebounded off the underside of the bar before Ollie Watkins smashed his rebound well over.
There was a blow for Villa as captain John McGinn limped off with a hamstring injury in the first half and Emery does not know how long he will be out.
"It is his hamstring. He could be out for two, three, four, five weeks, I don't know," Emery said.
In a first half lacking any excitement, Villa were possibly unlucky not to have been awarded a penalty after Boubacar Kamara went to ground in the box following a challenge from Mavididi.
The video assistant referee deemed it a fair challenge, despite there being obvious contact.
With the scores level, Villa looked short of ideas, with striker Jhon Duran suspended, leading Emery to look to his bench for inspiration.
The Spanish manager sent on Dutch wing-back Maatsen and it was his bursting run down the left that provided the key moment, as he sent in a pinpoint low cross for Bailey's winner.
Villa remain eighth in the table, just four points behind Chelsea in fourth while Leicester are second from bottom, two points from safety.