El Shaarawy has been in sensational form this season and has netted 18 times in 32 appearances in all competitions, 16 in Serie A.
The player has revealed his pride to play for Milan and was delighted to agree terms on a new deal.
He tweeted: "I am delighted to renew. I am proud to wear this shirt."
Milan are currently fourth in Serie A, a point ahead of city rivals Inter Milan.