The Rossoneri announced on Monday the 21-year-old Spaniard will be tied to the Serie A club until June 30, 2023 and will wear the number 10 shirt.
Diaz spent last season on loan at San Siro where he scored four goals and provided three assists in 27 games in Serie A, 17 of which ended in victories for Stefano Pioli's side.
The former Manchester City man, who signed for Madrid from the Premier League club in January 2019, had 26 shots for Milan last season with a conversion rate of 15.38.
Diaz, a technically gifted and skilful attacker, joined City in 2015 after showing promise in Malaga's youth ranks.
Although he was regarded as one of City's best prospects alongside Jadon Sancho and Phil Foden, Diaz followed the former in leaving the club in search of more opportunities.
He won his first cap for Spain in June when he started and scored in a 4-0 friendly win over Lithuania, a match where Luis Enrique was forced to call up his country's under-21 squad en masse. Sergio Busquet's positive COVID-19 test in the build-up to Euro 2020 left La Roja's senior team in isolation.
"Happy to be back. Thank you for all the love I have received," Diaz said.