Philip Roberts scored a stoppage time goal to earn Inverness a Scottish Cup draw with Highland rivals Ross County.
Billy McKay volleyed the visitors ahead on 30 minutes, while Rocco Quinn levelled with a glorious 20-yard shot.
A McKay shot deflected in off Foran before a strike from Iain Vigurs spun off a defender to loop into the net.
A 93rd-minute Richard Brittain free-kick appeared to have won the game for the hosts but Roberts had the last say from close range in a frantic finale.
The teams will meet again on 11 December to settle the fourth round tie.
County did most of the pressing in a scrappy opening spell but were limited to wild shots from Stuart Kettlewell and Richard Brittain and an awkward prod from Sam Morrow that bobbled wide.
Almost half an hour had passed before Inverness threatened, with Mark Brown making a smart save from Aaron Doran's fierce strike, following a good headed flick-on from Foran.
Soon after, Caley Thistle were ahead thanks to McKay's 10th goal of the season.
Doran clipped an angled free-kick into the penalty box and Foran headed the ball back across goal for the Northern Irish striker to crack in a lovely volley from 14 yards, that went in off the post.
County responded with Gary Glen firing a dangerous ball across goal but Kettlewell was stretching to reach it at the back post and could not steer the ball on target.
And the first half finished with a flurry of activity, as Brittain curled a free-kick against Reguero's near post from a tight angle
The ball fell to Vigurs in a packed penalty area and the County midfielder's shot was cleared off the line by Foran.
The visitors immediately launched a swift counter-attack and when Doran was tackled the ball broke to McKay, who went wide to round Mark Brown but the striker's shot was blocked by a defender in blue.
From the resulting corner, Foran rose well to connect with a header but sent the ball narrowly wide of the unguarded back post.
The second half was just a few minutes old when County drew level with a goal of the highest quality.
Full-back Mihael Kovacevic galloped forward to the right edge of the penalty area and laid the ball off for Quinn, who looped a curling, first-time strike over Reguero and into the top corner of the net.
Buoyed by such a fine strike, the home side had their tails up and Inverness were pinned back, making a series of last-ditch challenges in the final third of the pitch.
Kettlewell did manage to get in behind the visiting defence but steered his header wide from a promising position.
Reguero then had to smother a low drive from Brittain as the one-way traffic continued.
Having weathered the County storm, Inverness rediscovered some of the form that has made them the Scottish Premier League's top scoring team as a smart turn and shot from Andrew Shinnie drew a good diving save from Brown.
But when Caley Thistle's second goal arrived it owed much to a huge slice of fortune.
Shinnie worked the ball to McKay for the striker to set his sights for a curling shot from 20 yards.
McKay's effort was sailing wide before it struck the face of Foran, who had strayed a yard offside, and the deflection completely wrong-footed Brown as the ball bounced into the middle of the net..
With five minutes remaining, the game was level again and there was another element of luck involved as Vigurs drove forward from midfield and unleashed a shot that took a wicked spin off defender David Raven and away from the grasping fingertips of Reguero.
Stoppage time was running out when Brittain lashed in a low, curling free-kick from the left and it nicked the shoulder of Scott Boyd before evading everyone else and nestling in the net.
With the home support busy celebrating, Inverness midfielder Owain Tudor-Jones thundered in shot from 40 yards that was awkwardly patted away by Brown.
And from the corner, Josh Meekings' header was poked towards goal by Foran and struck the knees of Roberts from close range to level an amazing game for a third time.
- 25 Brown
- 03 Fitzpatrick
- 05 Boyd
- 06 Tokely
- 22 Kovacevic
- 07 Kettlewell (Fotheringham - 81' )
- 10 Brittain
- 11 Vigurs
- 12 Quinn
- 17 Morrow (Ross - 79' )
- 20 Glen
- 01 Fraser
- 04 Munro
- 21 Cooper
- 24 Ross
- 29 Fotheringham
Inverness Caledonian Thistle
- 12 Reguero
- 02 Raven
- 03 Shinnie
- 05 Warren
- 14 Meekings
- 04 Tudur-Jones
- 08 Draper Booked
- 10 Shinnie Booked
- 07 McKay (Roberts - 90' )
- 09 Foran
- 17 Doran
- 01 Esson
- 32 Cooper
- 22 Pepper
- 18 Sutherland
- 23 Roberts
Live Text Commentary
Full Time The referee blows his whistle to end the game.90:00 +4:51
Assist by Gary Warren.90:00 +4:51 Goal scored
Goal! - Richie Foran - Ross Co 3 - 3 Inverness Richie Foran gets on the score sheet with a goal from inside the six-yard box low into the middle of the goal. Ross County 3-3 Inverness CT.90:00 +3:56
Graeme Shinnie takes a inswinging corner.90:00 +2:33
Assist by Iain Vigurs.90:00 +2:33 Goal scored
Goal! - Richard Brittain - Ross Co 3 - 2 Inverness A goal is scored by Richard Brittain from 30 yards to the bottom right corner of the goal. Ross County 3-2 Inverness CT.90:00 +2:08
Free kick awarded for an unfair challenge on Iain Vigurs by David Raven. Richard Brittain delivers the ball from the free kick right-footed from left wing,90:00 +1:40
Free kick taken by Mark Brown.90:00 +1:40 Booking
Booking Booking for Andrew Shinnie for dissent.90:00 +1:32
David Raven challenges Iain Vigurs unfairly and gives away a free kick.90:00 +1:06 Substitution
Substitution (Inverness CT) makes a substitution, with Philip Roberts coming on for Billy McKay.89:51
Free kick awarded for an unfair challenge on David Raven by Steven Ross. Josh Meekings takes the free kick.88:36
Corner taken left-footed by Iain Vigurs to the near post, Gary Warren manages to make a clearance.85:06 Goal scored
Goal! - Iain Vigurs - Ross Co 2 - 2 Inverness Iain Vigurs fires in a goal from a long way out to the top left corner of the goal. Ross County 2-2 Inverness CT.81:54
Inswinging corner taken right-footed by Iain Vigurs.81:28
Inswinging corner taken left-footed by Iain Vigurs, Richie Foran makes a clearance.80:01
Indirect free kick taken by Mark Brown.80:01 Substitution
Substitution Stuart Kettlewell leaves the field to be replaced by Mark Fotheringham.80:01 Booking
Booking Ross Draper receives a caution for unsporting behaviour.79:53
Unfair challenge on Stuart Kettlewell by Ross Draper results in a free kick.
Shot by Owain Tudur Jones. Save by Mark Brown.78:11
Graeme Shinnie takes a inswinging corner from the right by-line to the near post, Iain Vigurs makes a clearance.78:11 Substitution
Substitution Steven Ross comes on in place of Sam Morrow.75:29
Foul by Owain Tudur Jones on Stuart Kettlewell, free kick awarded. Mark Brown takes the indirect free kick.73:41
Stuart Kettlewell challenges Richie Foran unfairly and gives away a free kick. Free kick taken by Graeme Shinnie.73:22
Billy McKay provided the assist for the goal.73:22 Goal scored
Goal! - Richie Foran - Ross Co 1 - 2 Inverness Richie Foran scores a goal from inside the area low into the middle of the goal. Ross County 1-2 Inverness CT.72:57
Billy McKay takes a shot.70:50
Gary Glen is ruled offside. Free kick taken by Josh Meekings.69:59
Andrew Shinnie has an effort at goal. Save made by Mark Brown.67:39
Billy McKay concedes a free kick for a foul on Scott Boyd. Indirect free kick taken by Mark Brown.67:04
Richard Brittain has an effort at goal. Save made by Antonio Reguero.64:48
Free kick awarded for a foul by Aaron Doran on Richard Brittain. Direct free kick taken by Scott Boyd.61:13
Free kick awarded for a foul by Richard Brittain on Andrew Shinnie. Graeme Shinnie crosses the ball in from the free kick.59:28
Free kick awarded for a foul by Graeme Shinnie on Gary Glen. Direct free kick taken by Iain Vigurs.58:47
Graeme Shinnie takes the inswinging corner, clearance by Ross Tokely.56:01
Free kick awarded for an unfair challenge on Billy McKay by Scott Boyd. Aaron Doran takes the direct free kick.54:18
Graeme Shinnie gives away a free kick for an unfair challenge on Stuart Kettlewell. Direct effort from the free kick comes in from Iain Vigurs, save made by Antonio Reguero.53:11
Headed effort from inside the area by Stuart Kettlewell misses to the left of the goal.51:57
Billy McKay is caught offside. Indirect free kick taken by Mark Brown.49:44
Unfair challenge on Ross Draper by Rocco Quinn results in a free kick. Graeme Shinnie takes the direct free kick.48:23 Goal scored
Goal! - Rocco Quinn - Ross Co 1 - 1 Inverness Rocco Quinn finds the net with a goal from outside the penalty area to the top left corner of the goal. Ross County 1-1 Inverness CT.48:23
Mihael Kovacevic provided the assist for the goal.46:01
Iain Vigurs has an effort at goal. Save by Antonio Reguero.45:01
The game restarts for the second half.45:00 +2:15 Half time
Half Time It is the end of the first-half.45:00 +1:24
Corner taken by Graeme Shinnie played to the near post, Richie Foran has a headed effort at goal from close in which goes wide left of the target.45:00 +0:46
Iain Vigurs takes a shot. Clearance by Josh Meekings.44:29
Free kick awarded for an unfair challenge on Mihael Kovacevic by Graeme Shinnie. Richard Brittain crosses the ball from the free kick right-footed from left wing, save by Antonio Reguero.41:30
Inswinging corner taken right-footed by Richard Brittain from the left by-line to the near post.41:06
Aaron Doran challenges Richard Brittain unfairly and gives away a free kick. Direct free kick taken by Scott Boyd.37:40
Free kick awarded for a foul by Scott Boyd on Richie Foran. Free kick taken by Owain Tudur Jones.36:56
Andrew Shinnie challenges Rocco Quinn unfairly and gives away a free kick. Richard Brittain takes the free kick.32:51
Corner taken by Graeme Shinnie from the right by-line played to the near post, Shot by Richard Brittain. Save by Mark Brown.31:26
Ross Tokely concedes a free kick for a foul on Ross Draper. Josh Meekings takes the direct free kick.29:31 Goal scored
Goal! - Billy McKay - Ross Co 0 - 1 Inverness Billy McKay finds the back of the net with a goal from the edge of the penalty box to the top left corner of the goal. Ross County 0-1 Inverness CT.29:31
Richie Foran provided the assist for the goal.28:54
Foul by Ross Tokely on Billy McKay, free kick awarded. Free kick taken by Aaron Doran.28:22
Shot by Aaron Doran. Save made by Mark Brown.27:20
Effort on goal by Richard Brittain from long range goes over the bar.24:57
Unfair challenge on Andrew Shinnie by Rocco Quinn results in a free kick. Graeme Shinnie takes the free kick.24:32
Free kick awarded for an unfair challenge on Richard Brittain by Owain Tudur Jones. Richard Brittain takes the direct free kick.23:23
Stuart Kettlewell gives away a free kick for an unfair challenge on Richie Foran. Josh Meekings takes the direct free kick.22:26
Free kick awarded for an unfair challenge on Andrew Shinnie by Mihael Kovacevic. Antonio Reguero takes the free kick.17:14
Sam Morrow produces a volleyed right-footed shot from deep inside the penalty box which goes wide of the left-hand post.16:49
Richard Brittain fouled by Owain Tudur Jones, the ref awards a free kick. Richard Brittain takes the free kick.15:56
Stuart Kettlewell produces a right-footed shot from just outside the penalty area that goes harmlessly over the target.13:17
Ross Draper concedes a free kick for a foul on Richard Brittain. Mark Brown takes the direct free kick.9:15
Mihael Kovacevic fouled by Owain Tudur Jones, the ref awards a free kick. Richard Brittain takes the direct free kick.7:34
Graeme Shinnie takes a inswinging corner from the right by-line played to the near post, clearance made by Mihael Kovacevic.5:35
Free kick awarded for an unfair challenge on Andrew Shinnie by Mihael Kovacevic. Graeme Shinnie restarts play with the free kick.0:00
The ref blows the whistle to start the match.
Live data and text provided by our data suppliers