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.