Birmingham City 1 Aston Villa 2
Agbonlahor was certainly Villa's hero as, only two minutes before he notched his 87th minute winner, he had dramatically cleared a Liam Ridgewell header off the line.
Earlier, Villa had been given the lead by an own goal by their former central defender Ridgewell.
This goal was cancelled out by substitute Mikael Forssell, but then Agbonlahor sealed Villa's win - their third in the last nine games against their local rivals.
It was a dramatic finish and Birmingham's defeat has dragged them into the relegation dog-fight.
It was the second successive match they have conceded a winning goal in the last five minutes of the game.
Villa, beaten only once on the road this season, continued their climb up the table in their bid for European football next season.
The game bore no resemblance to the recent behind-closed-doors friendly when Villa won 4-3 despite a hat-trick from Forssell.
That encounter was described as "feisty" and "tasty" by Birmingham boss Steve Bruce.
The real thing was untidy and lacking real inspiration and it might well have been different if Birmingham's fast start had produced an early goal.
They attempted to put Villa out of their stride but this dramatically back-fired when Villa took their shock lead with their first direct attack on Birmingham's goal.
There was something tentative about the way Birmingham handled the attack. There appeared to be very little danger from Stiliyan Petrov's low cross from the right.
But for one moment, Ridgewell must have forgotten he had switched clubs as he tamely turned the cross into his own net to his subsequent consternation.
Birmingham continued to be apprehensive and certainly lacked a direct style to put Villa's defence out of their stride.
Essentially it was a case of Villa containing their opposition and looking dangerous on the break.
John Carew had a quiet game, although it was only a fine save by Maik Taylor in the first half which prevented him marking his return with a goal.
There was a debatable incident in the first half when Daniel de Ridder cut inside and fell forward following a challenge from Martin Laursen.
Birmingham fans thought it was a penalty, but referee Steve Bennett thought otherwise and booked the Dutchman for diving.
With Wilson Palacios completely out of touch, it was hardly a surprise that Bruce drafted in Forssell for the second half.
It was a move which was fully justified as Forssell, who has struggled for the last three years with knee problems, delighted the home fans with a 62nd minute equaliser when he headed in a right-wing cross from de Ridder.
Forssell undoubtedly lifted Birmingham's spirits. Cameron Jerome responded to the situation and only a fine save by Scott Carson kept out a blockbuster of a shot.
But Villa had only themselves to blame for not sealing the game in the 70th minute when Gareth Barry headed to the unmarked Nigel Reo-Cocker who scooped the ball over the bar in front of an open goal.
But Agbonlahor had the final say. Following his goalline clearance, he notched a dramatic late when he headed home Ashley Young's left-wing cross.