The 230year-old El Shaarawy initially joined the Giallorossi on loan in January with an option to buy – an option that the club exercised on Tuesday.
The club paid €13 million as part of the deal, with the player signing a four-year contract that expires on 30 June 2020.
“Today is a very special day for me because I am now a Roma player in every way,” El Shaarawy said.
“I would like to thank the president, Mr Pallotta, sporting director Walter Sabatini, coach Luciano Spalletti, my teammates and the entire AS Roma staff for the faith they have shown in me from day one – and especially the Giallorossi fans, who welcomed me with warmth and affection.
“Together we will achieve big things … Daje Roma!”
El Shaarawy scored eight goals in 16 Serie A appearances last season, playing a further two games in the Champions League.
The Italy international began his career at Genoa, going on to join Milan in 2011. He spent the first half of last season on loan at French side AS Monaco, before making the switch to the Stadio Olimpico.
Also on Tuesday, Roma completed the signing of Slovakia international Norbert Gyomber on a permanent basis from Catania for €1.5m, as well as Nigerians Sadiq Umar and Abdullahi Nura from Spezia for €2.5m each.