The Twitter account of Milan's official television channel revealed the news with a message welcoming the keeper on Saturday morning.
The Serie A side's CEO and vice-president, Adriano Galliani, also confirmed the news to fans on Saturday.
"Diego Lopez to Milan is a done deal at 99%," he is quoted as saying by Italian publication Gazetta dello Sport.
Lopez is expected to undergo a medical on Monday before signing a four-year contract with the San Siro outfit in a deal that will see the 32-year-old earn about €2.5million per season.
The transfer comes just days after the Spaniard - who was also being tracked by Napoli and Liverpool - reportedly told Real directors that he believed he was the best goalkeeper currently at the club.
Lopez arrived at Real midway through the 2012/13 season from Sevilla after being signed by the side's former coach, Jose Mourinho, when first-choice keeper Iker Casillas suffered an injury.
The 32-year-old held onto his place in between the posts for for the rest of the campaign, despite Casillas recovering from his injury, before Lopez shared the responsibilities with the club captain last season.
Lopez then rejected a move to Ligue 1 outfit Monaco last summer to stay in Madrid and fight for his place but, following the arrival of Costa Rica star Keylor Navas from Levante this summer, Lopez has been forced to move on.
Lopez came up through Madrid's youth system but joined Villarreal in 2007 - where he was named the best new goalkeeper one year later - before moving to Sevilla in 2012.