The 39-year-old midfielder's arrival was confirmed by newly-appointed Milan coach Massimiliano Allegri earlier this month.
"Very happy to be here to start a new chapter in my career," said Modric, who turns 40 in September, in an Instagram video shared by Milan.
Modric will wear the number 14 shirt, Milan said in a statement.
"It's an immense honour for them to compare me to (Cruyff)... I wore the no. 14 at Tottenham in honour of him, and because the no. 10 wasn't available," Modric had said after winning the Ballon d'Or award in 2018.
Modric, regarded as one of the greatest midfielders of all time, announced in May that he would leave Real after the Club World Cup. He made 597 appearances for the Spanish club, winning 28 trophies, including four LaLiga and six Champions League titles.
He played his last game for Real on Wednesday, coming on as a second-half substitute during a 4-0 loss to Paris St Germain in the Club World Cup semi-finals.
"It's a bitter end... he's a legend of world football and of Real Madrid. He'll be remembered for many more good things than for the 25 minutes he played today," Real Madrid manager Xabi Alonso said after the match.
Widely considered Croatia's greatest player of all time, he has represented the country 188 times, scoring 28 goals. He won the Golden Ball at the 2018 World Cup, where he led Croatia to the final for the first time.
He also won the Ballon d'Or the same year, becoming the first player other than Lionel Messi and Cristiano Ronaldo to win the prestigious annual award since 2007.
Modric's arrival reinforces a Milan midfield that also features Youssouf Fofana, Yunus Musah and Ruben Loftus-Cheek, with Samuele Ricci joining from Torino earlier this month.
Milan, who failed to qualify for a European competition after finishing eighth in the Italian top-flight league last season, begin their Serie A campaign against newly-promoted Cremonese on August 23rd.