Real Madrid are replacing Zinedine Zidane with a familiar face.
"I have complete respect for everyone associated with Everton and hope they can achieve the exciting opportunities they have in front of them," the decorated Italian said. "While I have enjoyed being at Everton, I have been presented with an unexpected opportunity which I believe is the right move for me and my family at this time."
The 61-year-old bench boss had three years left on an Everton deal that reportedly paid him £11 million per season. Ancelotti, who joined the Toffees in 2019, oversaw a disappointing 10th-place finish this past season.
Though he recently dismissed the idea of making a sensational return to the Bernabeu, Real Madrid president Florentino Perez pushed hard for the move following Zidane's decision to relinquish his post.
Ancelotti previously spent three years in the Spanish capital, delivering the vaunted Decima - Real Madrid's 10th Champions League title - in 2014. He won four trophies with Los Blancos before being fired in 2015.
Upon his return, Ancelotti will inherit a squad coming off a trophyless campaign and in need of rejuvenation.
Everton, meanwhile, said they will "immediately" begin their search for a new manager. Nuno Espirito Santo and Eddie Howe are believed to be among the potential candidates.