Atalanta have beaten nine-man Sassuolo 3-1 to retain third place in the final round of the Serie A as Inter Milan claimed the fourth available UEFA Champions League slot.
Inter, who trail Atalanta on head-to-head record, edged Empoli 2-1, dooming the Tuscany side to relegation as third-bottom finishers on Monday (AEST), while fifth-placed AC Milan and Roma fill the two Europa League slots.
Sassuolo had captain Domenico Berardi red-carded in a brawl at half-time after putting his side ahead with a low drive as Duvan Zapata flicked in for 1-1 in the 35th.
Atalanta clinched their first-ever qualification for the Champions League as captain Alejandro Gomez flicked in after the break and crossed for the winning header of substitute Mario Pasalic.
Francesco Magnanelli exited with a second booking with seven minutes left.
Keita Balde also came off the bench to put Inter ahead on 51 minutes before his teammate Mauro Icardi had a penalty saved and the unmarked Hamed Traore levelled in the 76th.
Radja Nainggolan tapped in the winner on 81 minutes after Matias Vecino's drive came off the post, but the bar saved the Nerazzurri when defender Danilo D'Ambrosio cleared a low cross in the 89th.
Keita was sent off after receiving a second caution in stoppage time.
AC Milan went two up from Hakan Calhanoglu and Franck Kessie drives, but headers from Francesco Vicari and Mohamed Fares levelled for SPAL before Kessie converted a penalty on 66 minutes.
Roma beat guests Parma 2-1, Fiorentina and Genoa drew 0-0 and avoided relegation, while Udinese rallied to beat hosts Cagliari 2-1.
Champions Juventus ended the season with a shock 2-0 defeat at mid-table Sampdoria in coach Massimiliano Allegri's last match in charge.
Juve had secured the Scudetto with five games remaining, extending their record run to eight successive titles.
Torino beat visiting Lazio 3-1 earlier on Monday to clinch seventh place.
Iago Falque and Sasa Lukic struck early in the second half before the Romans' striker Ciro Immobile pulled one back in the 66th and Lorenzo De Silvestri clinched victory on 80.
Lazio, who sit four points behind Il Toro, secured the third available place for the Europa League as winners of the Coppa Italia.
The season's 38th and last round opened on Sunday with relegated sides Frosinone and Chievo drawing 0-0 as Bologna beat second-place Napoli 3-2.