Craig Beattie's stoppage-time penalty for Hearts knocked out holders Celtic to set up a first Edinburgh derby Scottish Cup final since 1896.
The former Celtic striker was handed the chance when Marius Zaliukas' shot came off Joe Ledley's hand.
Rudi Skacel had fired Hearts into the lead two minutes after the break.
Gary Hooper looked offside as he headed the equaliser with three minutes left, but Beattie's spot kick ended Celtic's hopes of a league and Cup double.
It sparked fury on the Celtic bench, with manager Neil Lennon racing on to the pitch to confront referee Euan Norris about the penalty award, as Hearts celebrated reaching the final against Hibernian on 19 May.
Both sides had gone into the game seeking their third straight win, but Lennon was forced to rule out Adam Matthews with a mouth infection, meaning a rare start for Sweden right-back Mikael Lustig.
Stephen Elliott was given the nod up front for Hearts - with Beattie only regarded fit enough for the bench and Gary Glen dropping out of the squad completely - and was given given an early chance to prove his sharpness.
He intercepted a poor back pass from Kelvin Wilson but had his shot blocked by goalkeeper Fraser Forster at point-blank range.
Celtic started to pick their passes and a Kris Commons free-kick found Lustig, who ought to have done better than head over from eight yards, while Ian Black was perhaps fortunate to pick up only a yellow card with a high and late challenge on Ledley.
Hooper, who appeared to be given a deeper role than normal, glanced a header across the face of goal following a fine curling Charlie Mulgrew cross as Celtic started to take control.
Commons was handed a great chance to score when Webster was short with a back-pass, but the Scotland winger miscontrolled his attempt to round goalkeeper Jamie MacDonald.
Somehow the Edinburgh side survived unscathed until the break after a pinpoint cross from Georgios Samaras found the diving head of Ki Sung-Yeung, but the ball rebounded off the inside of the post and clear.
Hearts manager Paulo Sergio made a change at the break, with Scott Robinson being replaced with Beattie, who made an impact within 70 seconds.
The former West Brom and Swansea striker's pass deflected off Wilson into the path of Skacel, who rounded Forster and fired into the roof of the net.
Ki went close to an equaliser with a blistering drive from 16 yards that just evaded the crossbar.
Skacel then forced a full-stretch diving save from Forster with a powerful effort from 20 yards and fired another effort just wide.
Celtic were looking more dangerous with Anthony Stokes on for Samaras and the substitute's low drive tested MacDonald.
Ki had another great chance with a header but found the outside of the post from five yards after being found unmarked by Commons, whose next free-kick was clawed away by MacDonald.
The goalkeeper saved superbly following a Mulgrew header and Stokes could only aim the rebound across the face of goal from two yards.
However, the pressure finally told when Mulgrew's cross found Hooper, who headed home from 10 yards when the striker had a yard start behind the defence.
It was Celtic's turn to feel aggrieved moments later when Zaliukas' shot deflected off the arm of Ledley, then brushed Victor Wanyama's hand and Beattie drove the penalty down the centre and into the net.
Ledley almost made amends with a back-post volley that MacDonald managed to hold and send Hearts into the final despite Celtic's late claim that of a hand ball against Webster.