The Portuguese coach joins on a three-year contract and will officially take charge on July 13, when the preseason starts, the club said on Thursday.
Mourinho left no one in Spain indifferent to his abrasive, yet undeniably successful, managerial style when he first coached Real from 2010-13.
During his first run, he led Real to a Spanish league title and a Copa del Rey crown. Yet he is more remembered for his confrontational personality that ended up splitting his own squad and alienating all but the most hardcore fans.
He will now inherit an underachieving team and rejoin a club in disarray.
Real have not won a major title in two years, with superstar striker Kylian Mbappé onboard. The club went through two coaches in Xabi Alonso and Álvaro Arbeloa this season.
The record 15-time European Cup winners have furthermore been embarrassed by series of unseemly events. There was a fight between players, fans jeering the team, and players questioning Arbeloa's decisions.
Club president Florentino Pérez added to the sense of a club in crisis by giving a press conference to announce he would call early elections, which he then won, while blasting the media for what he considered a campaign to force him to quit.
Mourinho famously proclaimed himself as "a special one" over two decades ago when he was introduced as Chelsea's coach, having led FC Porto to a surprising Champions League title in 2004.
He lived up that claim, making Chelsea Premier League champions before he steered Inter Milan to the 2010 Champions League title.
After winning the 2012 La Liga title, Real and Mourinho parted ways in 2013 with three years left on his contract. That followed a shock loss in the Copa del Rey final to Atletico Madrid and with media reports of him falling out with some of his players.
Mourinho may not be so special any more. Now 63, he has lost his status of being a serial champion who only coaches elite clubs.
His brilliant career has dimmed after a frustrating spell at Manchester United from 2016-2018. Since then, he has coached at Tottenham, Roma, Fenerbahce, and, last season, Benfica.
His only trophy since leaving United was the 2022 Conference League, Europe's third-tier competition, won with Roma.