Champions Juventus suffered a first Serie A home defeat in 40 matches, losing to Roma as they finished only one point clear of Inter Milan.
Juve secured a ninth consecutive title with two games to go, but end the domestic campaign with only two wins in their final eight games.
Gonzalo Higuain gave Maurizio Sarri's side the lead but Nikola Kalinic headed Roma level before Diego Perotti scored twice to give them the win.
Inter beat Atalanta 2-0 to come second.
Antonio Conte's Inter were deserved winners with Danilo D'Ambrosio heading them ahead after 50 seconds, before Ashley Young's excellent curling effort after cutting in from the left-wing.
This is the first time Inter have finished second since 2010-11 - and also marks the first time the top two in Serie A were separated by just one point since 2001-02.
Atalanta failed to score for just the third time in Serie A this season, but finished on 98 goals - the highest total by any team in the Italian top flight in 68 years.
Elsewhere, Zlatan Ibrahimovic, 38, became the oldest player to score 10 goals in a Serie A season as AC Milan beat Cagliari 3-0.
Lazio striker Ciro Immobile won the Serie A Golden Boot and European Golden Shoe as he matched Gonzalo Higuain's record of 36 goals in an Italian top-flight season.
The 30-year-old scored in Lazio's 3-1 defeat by Napoli on the final day as his side finished fourth.
Fabian Ruiz put Napoli ahead before Immobile equalized from close range.
Lorenzo Insigne's penalty and Matteo Politano's late goal were enough for Gennaro Gattuso's side to win.
Juventus' Cristiano Ronaldo - who was rested on the final day - was Serie A's second top scorer with 31 goals, with Inter Milan's Romelu Lukaku on 23.
The European Golden Shoe rewards the top scorer across every European top-flight, with goals weighted by the quality of the league.
Immobile finished two goals clear of Bayern Munich's Robert Lewandowski, with Ronaldo third.
It was his third Serie A Golden Boot - winning in 2013-14 with 22 goals and sharing with Mauro Icardi on 29 in 2017-18.
This is the first time since 2006-07, when Roma's Francesco Totti won, that the Golden Shoe has not been won or shared by a La Liga player.
Barcelona's Lionel Messi had won the past three but only scored 25 this time - which was still enough to be La Liga top scorer.
Source: BBC Sports