Fiorentina remained 14th, four points above the relegation zone. Roma firmed up its position of fourth and moved a point behind city rival Lazio, which is playing Juventus in the Italian Super Cup on Sunday.
Fiorentina started brightly but was undone by two quickfire goals. Roma opened the scoring in the 19th when Lorenzo Pellegrini turned a number of defenders before placing a pass over the top to Nicolò Zaniolo, who volleyed it back across for Edin Džeko to tap in from five yards.
Roma doubled its lead two minutes later through an Aleksandar Kolarov free kick. Fiorentina pulled one back in the 34th when the ball ricocheted around the area and a Martin Caceres effort was deflected, turning into an assist for Milan Badelj to turn in from close range.
But Pellegrini sealed the result in the 73rd, curling into the bottom right corner after a one-two with Džeko. Zaniolo added the fourth lats. Teenager Dušan Vlahović, who scored the equalizer against Inter, hit the bar from a free kick in stoppage time.
More AP soccer: https://apnews.com/Soccer and https://twitter.com/AP_Sports