The 21-year-old former Manchester City player flew into Malpensa airport on Wednesday and has now finalised a deal to play for the Serie A club for the 2020-21 season.
"AC Milan is delighted to announce the signing of the Spanish footballer Brahim Abdelkader Díaz from Real Madrid CF on loan until June 30, 2021," read a Milan statement.
The Rossoneri also confirmed that Diaz has been handed the number 21 shirt at the San Siro.
Diaz only joined joined Madrid for an initial £15 million (£21m) fee in January 2019 after six years at Manchester City but has struggled for regular opportunities.
The former Malaga youngster, who joined City as a 16-year-old in 2015, has made just five La Liga starts for Los Blancos and was restricted to just six substitute appearances in the top-flight last season.
Official Announcement: Brahim. #RealMadrid— Real Madrid C.F. 🇬🇧🇺🇸 (@realmadriden) September 4, 2020
In total, the Spain Under-21 international made 21 appearances for Madrid in all competitions during his 20 months at the club, scoring two goals.
In July, Getafe president Angel Torres revealed the club had enquired over Brahim's availability, but the player turned down the offer of a loan move in favour of staying at Madrid.
Earlier this week, Diaz's agent criticised Madrid for failing to get the best out of the player and backed his move to San Siro.
Pedro Gonzalez said Los Blancos did not give him "the required space and above all the confidence he needed", adding that Diaz needs to "play continuously to bring out his full potential."
The Diaz deal completes a productive week for Milan after striker Zlatan Ibrahimovic signed a new one-year contract on Monday to end speculation about his future.
Prior to then, most of the transfer activity at the club involved outgoings, with Suso, Pepe Reina, Lucas Biglia, Ricardo Rodriguez and Giacamo Bonaventura leaving the club this summer.
Alexis Saelemaekers and Simon Kjaer, who joined on loan in January, both put pen-to-paper on permanent deals earlier this summer. They also signed 20-year-old full-back pierre Kalulu from Lyon at the start of last month.