Juventus booked a meeting with AC Milan in the final of the Coppa Italia, but they had to do it the hard way as they were forced to endure a penalty shoot-out by Inter.
Goals from Marcelo Brozovic (2) and Ivan Perisic secured a 3-0 victory for Inter on the night at the San Siro, and hauled them level in the tie after they had been overwhelmed in the first leg.
At one stage they looked on the verge of an amazing comeback as they looked to book a May date with their city rivals, but Juve progressed after 120 minutes of high drama, emerging triumphant on spot-kicks.
Having won the first leg 3-0, Juventus boss Massimiliano Allegri opted not start several of his big names for the return encounter, including Paul Pogba, Paulo Dybala, Mario Mandzukic and Gianluigi Buffon, while Claudio Marchisio was left in Turin due to injury.
But that gamble was very close to backfiring, as Inter captalised upon a defensive error to grab an early lead through Brozovic before Perisic added a breakaway goal four minutes into the second half.
Brozovic then claimed his second with a late penalty to force the game into extra-time, with Inter almost remarkably snatching a winner right at the end of 90 minutes with strong late chances.
Despite an additional 30 minutes, the two sides could not be separated and in the shoot-out, Juventus won 5-3 after Rodrigo Palacio had hit the crossbar with Inter's second kick.
It was left to Leonardo Bonucci to score the winning penalty, with the defender now set to miss the final through suspension after being shown a yellow card earlier in the game.
Eventual victory extended the visitors' unbeaten run in all competitions to 17 games.
Inter dominated the opening exchanges, penning Juve back inside their own half, and they deservedly took the lead after 16 minutes.
Former Inter man Hernanes failed to deal with a sloppy pass out from goalkeeper Neto, allowing Gary Medel to bundle him off the ball and tee up Brozovic, who fired home from just inside the box.
Having gained a way back into the tie, Inter continued to press forward and they went agonisingly close to doubling their lead on the night when Adem Ljajic cut in from the left and thundered a right-footed effort against the crossbar.
Juventus did improve steadily as the first half wore on, but they were still unable to trouble Juan Pablo Carrizo in the home goal before the break.
They almost found themselves undone for a second time on the stroke of half-time when Eder's mazy dribble created a chance for Ljajic, whose strike flashed just wide of Neto's right-hand post.
Inter were not to be denied four minutes into the second half, however, as the impressive Eder got away down the right and drove in a low cross for Perisic to slide the ball home at the far post.
Juventus responded by creating their first clear-cut chance of the night, as Simone Zaza was denied by the post after being cleverly played in by Alvaro Morata.
Having survived that scare, Roberto Mancini's men swiftly regained the initiative and again went close, this time through Yuto Nagatomo and a thumping header from Danilo D'Ambrosio, who climbed highest to meet a Ljajic cross.
With the home fans roaring them on, Inter continued to press for the equaliser in the tie, and it duly arrived with eight minutes left of normal time.
Perisic was tripped by Daniele Rugani in the box and Brozovic slammed the resulting penalty underneath Neto's dive and into the bottom corner.
Then, in a frantic finale to the 90 minutes, the overworked Neto was forced to produce a fine save to prevent Perisic's effort from creeping in at the near post and the Inter frontman was then fortunate to escape being sent off following an altercation with Juan Cuadrado.
Inter continued to press in the first half of extra time, with Perisic's header forcing another smart block from Neto, while a rare attacking foray from Juventus ended with Zaza's low shot almost finding the far corner of Carrizo's net.
The drama continued right to the last minute of extra time, when Carizzo was forced to deny Morata twice in quick succession.
That was followed by Palacio's heartbreak from the spot, before Bonucci had the decisive say, as Inter just failed to pull off what would surely have been one of the competition's most memorable comebacks.