The victory moved Roma up to 77 points with one game left in the race for the second automatic Champions League berth, one ahead of Napoli who play Torino later on Sunday.
"This win is for our supporters who have undeservedly had to go through a tricky campaign," Roma midfielder Miralem Pjanic told Sky Sport Italia.
Radja Nainggolan slammed home the opener in the 18th minute before Antonio Rudiger doubled the home side's lead with a 39th-minute header.
Roma hail epic Totti late show
Pjanic added a third when he was picked out by an excellent pass from the 39-year-old Totti and he finished calmly past Albano Bizzarri.
"Second isn't down to us," Pjanic added. "But Torino are always hard to beat at home, and Napoli won't have it easy.
"We did our part by winning and we're hoping they slip up."
Totti, whose future at the club remains uncertain, was introduced as a 59th-minute substitute for Mohamed Salah and the club's beloved captain received an emotional ovation in what may be his final match at the Stadio Olimpico.
Juventus win fifth successive Serie A title after Napoli loss
Frosinone's relegation to Serie B was confirmed as Matteo Politano scored an 85th-minute winner to secure a 1-0 away win for Sassuolo, who will take sixth place unless AC Milan better their result on the final day.
Palermo's 0-0 draw at fifth-placed Fiorentina moved them up to 17th on 36 points, one ahead of Carpi, who dropped into the bottom three after a 3-1 home defeat by nine-man Lazio.
Carpi's Nigerian striker Jerry Mbakogu had two penalties saved by Federico Marchetti while Lazio lost both Lucas Biglia and Filip Djordjevic to late red cards.
Sampdoria's miserable season continued when they were thumped 3-0 at home by local rivals Genoa, but results elsewhere meant that they and Udinese, who were held 1-1 at Atalanta, confirmed their Serie A status for next season.
COMMENTS
Comments are moderated and generally will be posted if they are on-topic and not abusive.
For more information, please see our Comments FAQ