The Spanish giants have announced on their official website that the Italian will be their new head coach for the next three seasons
The Italian coach has signed a three-year deal and will be presented on Wednesday to reporters and the general public.
Madrid immediately made Ancelotti their primary target following Mourinho's departure to Chelsea, but PSG initially refused to let go of the 54-year-old.
However, they have now opted to allow Ancelotti to move on after appointing Laurent Blanc as their new head coach.
"Real Madrid will present Carlo Ancelotti as the new coach of the first team for the next three seasons on Wednesday June 26," a statement on the club's website reads.
"The event will take place in the Santiago Bernabeu Royal Box at 13:00CET. Carlo Ancelotti will then appear before the media in the press room."
Ancelotti had been in charge of PSG since December 2011 and guided them to only their third Ligue 1 title in history this term and the first in 19 years.
He previously enjoyed success with Chelsea and AC Milan, while also coaching Juventus, Parma and Reggiana in the early stages of his career.