The Primera Liga side said on their Web site (www.realmadrid.com) they had reached an agreement to sell the 31-year-old international to the European champions but did not reveal the fee.
Milan confirmed the Brazil international had joined the club on their Web site (www.acmilan.com).
Emerson joined Real Madrid from Juventus for an estimated fee of 16 million euros ($21.56 million) last year after the Italian side were punished with relegation following a match-fixing scandal.
Emerson's signing was made at the request of new coach Fabio Capello who had made the holding midfielder a key part of his plans at both AS Roma and Juve.
However, the notoriously hard-to-please Real Madrid fans quickly got on the player's back after a shaky start to the season and he struggled to settle at the Spanish giants.
The Spanish media accused him of not wanting to play at the Bernabeu in front of a critical Real crowd when Capello left him out of the starting line-up for several home matches.
But the Brazilian recovered form in the latter part of the season and ended the campaign on a high when Real overhauled arch-rivals Barcelona to take their first league title in four years.
With Real deciding to sack Capello at the end of the season, Emerson's future at the club was cast into doubt and new boss Bernd Schuster made it clear that he did not feature in his plans.
More from rediff