Nikola Zigic's late winner sent Birmingham City into the Carling Cup semi-finals at the expense of arch-rivals Aston Villa at St Andrew's, a victory marred by ugly scenes between opposing fans after a mass pitch invasion at the final whistle.
Giant Serbian Zigic, who had struggled to make an impression and was becoming a target for the home fans' frustration, was suddenly transformed into the hero with only six minutes left.
Zigic bundled home Cameron Jerome's cross from close range, via a deflection off Luke Young, to settle a fiercely contested derby.
Sebastian Larsson gave Birmingham an early lead from the penalty spot after Richard Dunne had fouled Lee Bowyer, but Gabriel Agbonlahor grabbed a deserved equaliser for Villa before the interval.
Zigic thought he had extended the hosts' advantage before Agbonlahor's strike when his shot squirmed away from Villa keeper Brad Friedel - but as he claimed the ball had crossed the line a flag went up for offside.
Villa were the better side for long periods, but they failed to apply any sustained pressure on Blues keeper Ben Foster and paid the price for their lack of cutting edge as Zigic struck the decisive blow to set up a two-legged semi-final clash with West Ham.
Gerard Houllier's side will feel hard done by after controlling so much of the game, but all their promising approach play amounted to few clear-cut chances and it is Alex McLeish's side who have moved a step closer to only the second major trophy in their history, having won the League Cup against Villa in 1963.
Sadly, thousands of Birmingham supporters chose to celebrate the win by charging the length of the field to taunt their Villa counterparts, sparking a predictably angry reaction, with police forced to move in as flares were thrown.
It was an unsavoury end to what had been a pulsating encounter, denying the home side's players the chance to celebrate their triumph as they and the Villa players hurried off the pitch.
Villa were able to recall Agbonlahor after he missed Saturday's defeat against Arsenal through illness - and he played a central role in an evenly contested first 45 minutes.
Birmingham went ahead with their first serious venture into Villa territory, Bowyer tempting Dunne into a clumsy collision that left referee Chris Foy with an easy decision to point to the spot. Larsson completed the punishment for Villa and Dunne as he sent Friedel the wrong way with his penalty.
Despite Villa enjoying the majority of possession, it was the hosts who thought they had increased their lead in the 29th minute when Zigic's shot squirmed out of Friedel's grasp on the line. As Birmingham players claimed a goal, the linesman's flag was raised for offside, presumably against Liam Ridgewell, who was lurking behind Friedel.
If the Blues were nursing a sense of injustice, it was only increased moments later when the visitors drew level, Agbonlahor scoring with a right-foot finish on the turn after he was played in by Jonathan Hogg.
Jerome then wasted a glaring opportunity to restore Birmingham's advantage when he ran through with only Friedel to beat, but he watched in frustration as his effort drifted inches wide.
Villa continued to hold sway after the break, but with no clear chances being created, Houllier and McLeish decided to make changes. Birmingham replaced Bowyer with Craig Gardner, while Stephen Ireland replaced the tiring Barry Bannan for the visitors.
The home support were venting their frustration as they struggled to exert any authority on Villa, but Gardner gave them hope with a long-range drive that flew narrowly off target.
Ireland then had his own opportunity to make an impact when Birmingham were undone by Agbonlahor's pace, but his shot was saved by Foster, who recovered to deny Ashley Young as he waited to pounce on the rebound.
And as time ran out, McLeish's side hit their city rivals with a sucker punch as Zigic, who had struggled throughout the match, turned Jerome's cross tantalisingly out of the reach of Friedel with the help of a deflection off Luke Young.
Villa pressed in vain, and the conclusion of the game was scarred by the mindless behaviour of the supporters who raced on to the pitch at the final whistle to take the gloss off what was a landmark win.