Andrew Shinnie and Greg Tansey scored in extra time as Inverness advanced in the William Hill Scottish Cup with a fourth round replay victory at Dunfermline.
As in the first game, Andy Barrowman put Dunfermline in front after 40 minutes before a series of defensive errors led to Caley Thistle's equaliser after 54 minutes.
Goalkeeper Chris Smith and defenders Alex Keddie and Kevin Rutkiewicz all contrived to gift a tap in to Jonny Hayes, who was later booked for a row with captain Richie Foran.
Shinnie, making his return from a calf injury, netted an unstoppable angled drive three minutes into the first period of extra time before Tansey added a third after 110 minutes to earn Inverness a home fifth-round tie with holders Celtic on the weekend of February 4 and 5.
The victory extended Inverness' unbeaten run to five games and left the Pars - now with one win in 20 - still chasing a first win at their East End Park home this season.
Dunfermline will now turn their attentions to their Clydesdale Bank Premier League survival fight at Kilmarnock on Saturday.