Jonny Hayes netted a last-gasp leveller for 10-man Inverness to ensure a replay at East End Park against Dunfermline in the Scottish Cup fourth round.
The Irish winger pounced to tap in after a dreadful error from Pars goalkeeper Chris Smith in the fifth minute of stoppage time.
Caley Thistle goalkeeper Jonny Tuffey failed to clear on 29 minutes, letting in Andy Barrowman to score.
It followed the free-kick for which Kenny Gillet was shown a red card.
Northern Ireland international Tuffey had replaced ever-present goalkeeper Ryan Esson - who has failed to keep a clean sheet all season - in the one change to the Caley Thistle starting line-up.
Joe Cardle and Andy Kirk came in for Dunfermline, replacing Gary Mason and Paul Willis.
Hayes showed his attacking threat in front of 1,601 fans when he flashed a 30-yard free-kick over after 15 minutes.
Dunfermline's Martin Hardie then forced Tuffey into a save with a 25-yard free-kick that was the first shot on target.
The game sparked to life on 29 minutes when Gillet was shown a straight red card following a mix-up with Tuffey.
Caley Thistle's goalkeeper failed to clear a long ball and Barrowman nipped in before being brought down by Gillet on the edge of the box.
Referee Euan Norris gave the Frenchman his marching orders and Hardie's low free-kick was parried by Tuffey for Barrowman to nod home from close range.
At the opposite end, Smith was called into action moments later when Billy McKay turned smartly in the box before seeing his angled shot parried wide.
Hayes then headed over for the hosts from a similar angle after connecting with a long cross from Graeme Shinnie.
Smith thwarted Hayes moments before the interval when the winger shot low from 20 yards and, seconds later, a Hayes cross just needed a touch from either Gregory Tade or McKay as it floated inches wide.
The Pars goalkeeper was equal to another low Hayes shot from a 25-yard free kick, but no Inverness players anticipated the rebound and the goalkeeper clawed the ball back into his grasp.
Davis's cross-cum-shot towards the back post bounced off the crossbar as Caley Thistle continued to threaten.
Smith was almost caught out on 75 minutes when he flapped at a Davis corner, but Tade's header went wide.
Barrowman looked to punish the Highlanders further but shot just off target from outside the area.
However, there was late drama when Smith miskicked a clearance after Roman Golobart had kicked the ball long in the fifth minute of stoppage time.
Hayes capitalised on the error to sweep home the equaliser from just inside the box.
Inverness Caledonian Thistle
- 12 Tuffey
- 15 Tade
- 16 Golobart
- 19 Shinnie
- 22 Gillet Dismissed
- 02 Piermayr
- 06 Cox Booked (Meekings - 75' )
- 07 Hayes
- 25 Davis (Tansey - 80' )
- 09 Foran
- 21 McKay (Doran - 64' )
- 01 Esson
- 26 Meekings
- 08 Tansey
- 18 Sutherland
- 23 Doran
- 20 Smith
- 06 Keddie Booked
- 13 Boyle
- 15 Dowie
- 16 Potter
- 07 Cardle (Mason - 82' )
- 08 Hardie Booked (Thomson - 83' )
- 17 Burns Booked
- 09 Barrowman
- 10 Kirk Booked (Buchanan - 69' )
- 11 Graham
- 30 Goodfellow
- 39 Young
- 04 Mason
- 23 Thomson
- 19 Buchanan
Live Text Commentary
Full Time The referee blows his whistle to end the game.90:00 +5:12
Free kick awarded for a foul by Andy Dowie on Johnny Hayes. Indirect free kick taken by Roman Golobart.90:00 +3:56
Roman Golobart provided the assist for the goal.90:00 +3:56 Goal scored
Goal! - Johnny Hayes - Inverness 1 - 1 Dunf'mline Johnny Hayes finds the net with a goal from inside the six-yard box low into the middle of the goal. Inverness CT 1-1 Dunfermline.90:00 +3:05
Greg Tansey concedes a free kick for a foul on Gary Mason. John Potter takes the free kick.90:00 +1:29
Gregory Tade is flagged offside by the assistant referee. Indirect free kick taken by Chris Smith.90:00 +0:19
Paul Burns challenges Johnny Hayes unfairly and gives away a free kick. Graeme Shinnie restarts play with the free kick.89:37
Unfair challenge on Paul Burns by Richie Foran results in a free kick. Andy Dowie takes the free kick.88:35
Effort from 35 yards by Aaron Doran went wide right of the net.85:51
Inswinging corner taken from the left by-line by Ryan Thomson, Close range header by Alex Keddie misses to the right of the target.82:00 Substitution
Substitution Ryan Thomson replaces Martin Hardie.82:00 Substitution
Substitution Joe Cardle goes off and Gary Mason comes on.81:50
Martin Hardie produces a right-footed effort from long distance that goes harmlessly over the bar.79:31 Substitution
Substitution Greg Tansey is brought on as a substitute for David Davis.78:09
Liam Buchanan produces a right-footed shot from just outside the box that misses to the right of the net.76:37
Joe Cardle takes the outswinging corner, save made by Jonny Tuffey.74:49 Substitution
Substitution Josh Meekings comes on in place of Lee Cox.74:20
Inswinging corner taken from the left by-line by David Davis.73:47
Joe Cardle concedes a free kick for a foul on Johnny Hayes. Johnny Hayes crosses the ball in from the free kick.72:24
Corner taken right-footed by Joe Cardle from the right by-line to the near post, clearance made by Richie Foran.
Richie Foran takes the indirect free kick.71:54 Booking
Booking Paul Burns booked for unsporting behaviour.71:51
Paul Burns challenges David Davis unfairly and gives away a free kick.70:56
Free kick awarded for an unfair challenge on Richie Foran by Martin Hardie. David Davis restarts play with the free kick.68:24 Substitution
Substitution Liam Buchanan joins the action as a substitute, replacing Andy Kirk.67:51
Unfair challenge on Richie Foran by Martin Hardie results in a free kick. Jonny Tuffey takes the indirect free kick.67:22
David Davis produces a cross.66:49
Andy Kirk is penalised for a handball. Roman Golobart restarts play with the free kick.65:24
Shot on goal comes in from Johnny Hayes from the free kick, Chris Smith makes a save.65:24 Booking
Booking Martin Hardie is given a yellow card.64:57
Martin Hardie concedes a free kick for a foul on Richie Foran.63:41 Substitution
Substitution Aaron Doran comes on in place of Billy McKay.59:26
Shot from deep inside the area by Andy Kirk clears the bar.56:53
Thomas Piermayr challenges Joe Cardle unfairly and gives away a free kick. Martin Hardie fires a strike on goal direct from the free kick.53:56
Free kick awarded for a foul by Martin Hardie on Gregory Tade. David Davis crosses the ball from the free kick right-footed from left channel, save made by Chris Smith.50:30
John Potter restarts play with the free kick.50:30 Booking
Booking The referee books Lee Cox for unsporting behaviour.50:26
David Graham fouled by Lee Cox, the ref awards a free kick.49:53
Johnny Hayes takes a inswinging corner from the right by-line played to the near post, clearance made by Alex Keddie.48:58
Joe Cardle takes a shot. Save by Jonny Tuffey.46:08
Corner taken left-footed by Johnny Hayes, clearance made by Paul Burns.45:28
Short corner taken by Johnny Hayes from the left by-line.45:01
The referee starts the second half.45:00 +2:57 Half time
Half Time The match has reached half-time.45:00 +1:18
David Graham gives away a free kick for an unfair challenge on Richie Foran. Indirect free kick taken by David Davis. Thomas Piermayr takes a shot. Blocked by Martin Hardie.45:00 +1:00
Andrew Barrowman challenges Thomas Piermayr unfairly and gives away a free kick. Indirect free kick taken by Thomas Piermayr.43:09
Johnny Hayes takes a shot. Save by Chris Smith.42:25
David Davis fouled by David Graham, the ref awards a free kick. Free kick taken by Johnny Hayes.40:35
Free kick awarded for a foul by Andy Kirk on Lee Cox. Lee Cox takes the indirect free kick.36:59
Johnny Hayes produces a header from inside the six-yard box that clears the bar.36:12
Effort on goal by Roman Golobart from long distance goes over the crossbar.35:10
Billy McKay takes a shot. Save made by Chris Smith. Corner taken by Johnny Hayes played to the near post, clearance made by Alex Keddie.33:35
Martin Hardie takes a shot. Save by Jonny Tuffey.29:52
Assist by Martin Hardie. Save by Jonny Tuffey.29:52 Goal scored
Goal! - Andrew Barrowman - Inverness 0 - 1 Dunf'mline Andrew Barrowman finds the net with a headed goal from just inside the edge of the penalty box. Inverness CT 0-1 Dunfermline.28:03
Strike comes in from Martin Hardie from the free kick,28:03 Dismissal
Dismissal Red card for Kenny Gillet.27:37
Andy Kirk fouled by Kenny Gillet, the ref awards a free kick.25:15
Foul by Lee Cox on Andy Kirk, free kick awarded. Chris Smith restarts play with the free kick.21:39
Foul by David Graham on David Davis, free kick awarded. Indirect free kick taken by Graeme Shinnie.18:51
Foul by Andrew Barrowman on Roman Golobart, free kick awarded. Jonny Tuffey restarts play with the free kick.17:48
Richie Foran has an effort at goal from outside the penalty box missing to the wide left of the goal.16:22
Free kick awarded for an unfair challenge on Paul Burns by Gregory Tade. Martin Hardie shoots direct from the free kick, save by Jonny Tuffey.14:13
Free kick awarded for a foul by Alex Keddie on Gregory Tade. David Davis takes the free kick. Johnny Hayes takes a shot.14:13 Booking
Booking Booking for Alex Keddie.10:46
Foul by Billy McKay on Alex Keddie, free kick awarded. Indirect free kick taken by Chris Smith.9:20
Free kick awarded for an unfair challenge on David Davis by Paul Burns. Thomas Piermayr takes the free kick.8:02
Corner taken by Johnny Hayes from the left by-line played to the near post, David Graham makes a clearance.7:24
The assistant referee signals for offside against Billy McKay. Chris Smith takes the free kick.6:37
Joe Cardle takes the inswinging corner, clearance made by Richie Foran.4:40
Indirect free kick taken by Jonny Tuffey.4:40 Booking
Booking The referee books Andy Kirk for unsporting behaviour.4:17
Roman Golobart fouled by Andy Kirk, the ref awards a free kick.1:34
Andrew Barrowman concedes a free kick for a foul on Thomas Piermayr. Roman Golobart takes the free kick.0:00
The referee gets the match started.
Live data and text provided by our data suppliers