Lorenzo Pellegrini scored a last-gasp winner as Roma bounced back after their Italian Cup defeat by Spezia with a 4-3 win over the promoted side to move third in Serie A on Saturday.
Pellegrini blasted home in injury time, minutes after Daniele Verde had pulled Spezia level, with relieved Roma coach Paulo Fonseca racing to hug the midfielder.
"It was an incredible moment," said Fonseca.
"It showed the team spirit. We needed to win this game and it would have been incredibly unfair not to after how we played."
The capital side have been in turmoil since their chaotic 4-2 extra-time loss to Spezia on Tuesday.
The official scoreline was changed to 3-0 on Friday, as Roma made six substitutions, with just five allowed, during the last-16 clash which they finished with nine men.
Captain Edin Dzeko was left out of the team on Saturday, officially because of a muscular injury, but amid reports of a fall-out with Fonseca.
Borja Mayoral scored a double for the hosts, netting the first after quarter of an hour, only for Roberto Piccoli to pull 14th-placed Spezia level seven minutes later by pouncing on a mistake by home goalkeeper Pau Lopez.
Real Madrid loanee Mayoral slotted home his second on 52 minutes, before Rick Karsdorp tapped in to make it 3-1 three minutes later.