Inter Milan ended a six-season absence from the Champions League on Sunday when they produced an extraordinary fightback to win 3-2 at Lazio and push their opponents out of fourth place in Serie A.
The fixture list had pitted the two sides on the final day of the season in a direct battle for the fourth and final place in next season's Champions League group stage with Lazio needing a draw to qualify.
Lazio led 2-1 with 15 minutes left but were stunned after a Mauro Icardi penalty and Matias Vecino header turned the game around for Inter who last qualified in 2011-12.
The two sides finished level on 72 points but Inter took fourth place on the better head-to-head record, which is used to separate teams in Serie A.
They joined champions Juventus, Napoli and AS Roma in Europe's showcase competition next season.
Lazio drew first blood when Adam Marusic's off-target shot ricocheted off Ivan Perisic and into the net after nine minutes.
Inter levelled from a corner in the 29th minute with Danilo D'Ambrosio scoring at the second attempt. Lazio protested that D'Ambrosio clipped goalkeeper Thomas Strakosha's head in the process but the referee confirmed the goal after checking with the video assistant referee (VAR).
Felipe Anderson finished off a fulminating counterattack to put Lazio back in front before halftime but the drama was far from over.
Inter had a penalty awarded for handball and then revoked in the 75th minute but were given another spot kick in the 78th minute after Stefan de Vrij scythed down Icardi.
The Argentine took the penalty himself and converted to leave himself and Lazio forward Ciro Immobile as joint top-scorers in the league on 29 goals.
Lazio midfielder Senad Lulic was then sent off for a second bookable offence and Vecino capped an unforgettable night for Inter when he headed in from a corner in the 81st minute.
Elsewhere runners-up Napoli became the first team to amass more than 90 points and fail to win title after they beat Crotone 2-1, a result which condemned their opponents to relegation.
Lorenzo Insigne created both goals for Napoli as Arkadiusz Milik headed them in front after 23 minutes and Jose Callejon volleyed home from close range nine minutes later.
Napoli finished with 91 points after winning 28 and drawing seven of their 38 games.
Crotone last season pulled off one of the greatest escapes in Serie A history but there was to be no repeat this time for Walter Zenga's team and Marco Tumminello's 90th-minute consolation goal was far too late.
The team from Calabria finished 18th in the 20-team table with 35 points as they followed Benevento and Verona into Serie B.