Cristiano Lucarelli grabbed a hat-trick for relegation-threatened Livorno to deny Roma the chance to move within four points of Serie A leaders Inter Milan.
The Giallorossi squandered the lead on two occasions and also missed a penalty on an afternoon of frustration for coach Claudio Ranieri.
The hosts – who remain in the bottom three but at least gained a point on fourth-bottom Lazio – took the lead after nine minutes through Lucarelli, only for Simone Perrotta to level matters within 60 seconds.
Luca Toni then put the visitors in front with a controversial strike but Lucarelli netted again after 26 minutes to restore parity.
A breathtaking passage of play showed no sign of abating with David Pizarro restoring Roma’s lead approaching the half-hour mark and the visitors should have doubled their advantage before the break but Pizarro missed from the spot.
Lucarelli was more accurate from 12 yards with 20 minutes to go and Livorno held on despite a late Roma onslaught.