
Defender Juan Jesus gave sixth-placed Roma a 19th-minute lead, providing the final touch after Bryan Cristante headed on a corner at the near post.
Sampdoria, who lost their third match in a row and the second by a 4-1 scoreline, were awarded a penalty nine minutes after the restart for a foul by Kostas Manolas on Gaston Ramirez but referee Massimiliano Irrati changed his mind after consulting the VAR.
Patrik Schick added a second goal in the 59th minute, scoring from close range after Aleksandar Kolarov pulled the ball back from the byline, then Roma were awarded a penalty for handball by Omar Colley which was also revoked following a VAR review.
El Shaarawy curled in the third goal in the 72nd minute, Gregoire Defrel pulled one back for Samp, and El Shaarawy struck again in stoppage time.