Nine-man Inverness exacted League Cup semi-final revenge on Hearts, winning on penalties to set up a first major final against Aberdeen on 16 March.
Greg Tansey's wonderful strike put Inverness ahead but Jamie Hamill scored twice in two minutes for Hearts after Gary Warren was sent off.
Caley Thistle's Josh Meekings also saw red but the Highlanders grabbed an injury-time leveller through Nick Ross.
After a goalless extra-time, Ross Draper netted the crucial spot-kick.
His successful penalty eventually sealed the game, the outcome of which had swung like a pendulum.
Cruelly, Hamill was one of those who missed for Hearts in the shoot-out, Dean Brill saving the midfielder's effort after previously denying new signing Paul McCallum.
Interview - Inverness Caledonian Thistle boss John Hughes
It fulfilled the pre-match feelings of Caley Thistle manager John Hughes, who stated his players had a "glint in their eyes" as they readied themselves for getting their own back against Hearts at Easter Road.
For at the very same stage of the Scottish League Cup competition last season, it was the Tynecastle side who had progressed to the final via spot-kicks.
And seven points from nine in their last three league matches had Hearts feeling confident of coming out on top again.
However, Danny Wilson's third minute jitters almost had his side on the back foot immediately.
The Hearts captain dithered and Billy McKay swooped to cut back for Draper, who scooped over with his right foot when a shot on his left seemed the better option.
That early opportunity was the appetiser for a fast-paced first half not short of bite in the tackle, but one which produced no goals
Hearts midfielder Jamie Hamill is dejected after seeing his penalty saved
Dale Carrick and Sam Nicholson were the Hearts players giving Inverness goalkeeper Dean Brill most to think about in the opening 45 minutes.
Carrick glanced a header over the crossbar from Dylan McGowan's delivery, while Nicholson's driven shot from 20 yards stung the palms of the Englishman.
But the best opportunity came to McKay close to the half-time whistle.
Already on 18 goals this season, he sneaked goal-side of young defender Brad McKay to latch onto Draper's perfectly curled through ball, only to see Jamie MacDonald beat away the low angled effort which was headed for the far corner.
Inverness took the lead in spectacular fashion soon after the break.
Tansey's second stint with the Highlanders is only 17 days old and he could not have chosen a better way to endear himself to Caley Thistle fans once again - he thumped the ball into MacDonald's right-hand corner when the ball broke to him 20 yards out.
Hearts rallied and Brill had already made a fantastic save from Callum Paterson before the game turned on 66 minutes.
Interview - Hearts boss Gary Locke
Warren, one of those yellow carded in the first half, was deemed guilty of another after a tangle with Nicholson on the edge of the box.
Hughes' rage at the debatable sending-off was compounded when a well-worked Hearts free-kick brought the equaliser.
Ryan Stevenson, on as a substitute, cleverly rolled the ball to Hamill, whose relatively tame effort deflected off the foot of Draper and into the bottom corner.
Two minutes later Hearts were in front via another Hamill set-piece and there was no fluke about this one. Carrick won a free-kick when fouled by Josh Meekings, leaving Hamill to curl wonderfully into Brill's top left corner.
Meekings' bullet header almost restored parity for Inverness but MacDonald saved well, and the Caley Thistle defender's next major piece of action was getting sent off for a crude foul on Scott Robinson.
So Hearts found themselves in pole position for a place in the final, but there was to be another twist in the fifth minute of injury time when a tactical gamble by Hughes paid off.
Inverness manager John Hughes celebrates after his side reach their first major domestic final
He had thrown on Ross in place of David Raven and the midfielder dramatically ensured the game went to extra-time, firing home from the angle at the second attempt from close range despite MacDonald's best efforts.
Hearts piled on the pressure in extra-time and despite a couple of goalmouth scrambles, the nine men of Caley Thistle managed to prevent their goalmouth being breached.
Hughes' charges even tried snatching it themselves and had McKay and Ross go close to nicking a winner.
In the penalty shoot-out, Inverness's Graeme Shinnie and Hearts' McCallum failed to convert the opening kicks.
But Caley Thistle would not miss again, with Billy McKay, Ross, Tansey and Draper scoring to capitalise on Hamill's miss.
This page is best viewed in an up-to-date web browser with style sheets (CSS) enabled. While you will be able to view the content of this page in your current browser, you will not be able to get the full visual experience. Please consider upgrading your browser software or enabling style sheets (CSS) if you are able to do so.