The hosts had the game under control with a two-goal advantage, but lost their focus and were forced into extra time before the midfielder hit home
Substitute Antonio Candreva scored a 98th-minute winner to send Inter into the quarter-finals of the Coppa Italia with an enthralling 3-2 home win over Bologna.
Inter, fresh from six successive victories prior to Tuesday’s game, took the lead in magnificent fashion through Jeison Murillo, who produced a finish belying that of a centre half to convert Joao Mario’s corner with a sensational overhead kick.
Joao Mario then combined with Rodrigo Palacio to make it 2-0, but Bologna were given hope three minutes before half-time courtesy of Blerim Dzemaili’s deflected effort.
Stefano Pioli’s men had numerous opportunities to put the game to bed in the second half and eventually paid the price for not taking them when Godfred Donsah headed Bologna level.
A decisive goal did not arrive inside 90 minutes, but in the first period of extra time Inter benefited from a deflection of their own as Candreva struck what proved to be the winner.
Inter will now face the winner of Wednesday’s contest between Candreva’s old team Lazio and Genoa.
Brazil forward Gabriel Barbosa made his first start of what has been a torrid spell since joining from Santos and he forced Angelo Da Costa into the first meaningful save of the match.
But Da Costa could do nothing but stand in admiration in the 33rd minute when Murillo met Joao Mario’s delivery with a remarkable acrobatic finish.
The lead was doubled six minutes later, Joao Mario the architect again as his precise pass from the left flank found Palacio, who kept his composure to smartly tuck the ball into the bottom-left corner.
But Bologna halved the deficit shortly before the interval, launching a quick counter after an Inter attack came to an end when Barbosa surrendered possession and finishing off the move as Federico Di Francesco found Dzemaili, whose shot on the turn was deflected in by Geoffrey Kondogbia.
Joao Mario should have done better when presented with the chance to re-establish Inter’s two-goal lead five minutes after the restart, but succeeded only in turning his header from Eder’s cross wide of the left-hand post.
Da Costa then needed to be alert to prevent Palacio from doubling his tally from a corner and Eder bent wide from just inside the area as Inter continued to pile pressure on the Bologna goal.
Bologna remained a threat, though, Marios Oikonomou’s wayward close-range header serving as a warning to Inter, but Da Costa was by far the busier of the two keepers, making further stops to thwart Palacio and Joao Mario.
Gabriel was withdrawn to a warm ovation from the Inter fans as he was replaced by Candreva, but the applause turned to jeers after the home side’s profligacy was punished for a second time in the 73rd minute by Donsah, who left Juan Pablo Carrizo with no chance when he powered Adam Masina’s far-post cross into the net with a fine header.
Inter laid siege to the Bologna goal in the closing stages, but could not ensure progression in normal time and lived dangerously themselves in extra time, Gary Medel making a goal-mouth clearance from a Di Francesco cross.
However, Bologna’s defence remained suspect and Candreva capitalised by beating the excellent Da Costa after Mauro Icardi’s ball across the face of goal had been inadvertently flicked into his path.
The visitors never looked like mounting another revival, Inter seeing out the result to keep hopes of a first trophy since the 2011 Coppa success alive.