"We have taken the difficult decision to rescind the contract of Rafael Benitez as coach," said Madrid president Florentino Perez.
"The Real Madrid board has decided to name Zinedine Zidane as coach of the first team."
However, the club didn't announce the length of Zidane's contract.
Benitez's unhappy reign came to an end after a 2-2 draw away to Valencia on Sunday left Madrid four points adrift of local rivals Atletico Madrid at the top of La Liga.
They also trail eternal rivals Barcelona by two points having played a game more.
Zidane scored a sensational winning goal to hand Madrid the 2002 Champions League as a player, but is short on managerial experience having only ever taken charge of Madrid's feeder team Castilla.
The 43-year-old failed to get Castilla promoted from the third tier of Spanish football last season, but they currently lie second in the regional Segunda Division B having lost just two of 19 games this season.
And the Frenchman was part of Carlo Ancelotti's coaching staff when they won the Champions League and Copa del Rey in 2014.
"We have the best club in the world, the best fans and what we have to do now, and what I will try my best to do, is ensure the team wins at the end of the season," added Zidane.
"I am more emotional than when I signed as a player, but that is normal and from tomorrow I am going to put my heart into doing all I can for this club."
Zidane will take charge of his first game as boss at home to Deportivo la Coruna on Saturday.
Perez had publicly backed Benitez despite the growing pressure in recent weeks which saw him routinely jeered by his own fans, but is believed to have finally bowed to the will of the players and supporters.
Zidane is the 11th coach to be appointed under Perez in just over 12 years in two spells in charge of the club.
"As president it is an honour to have you at my side because I know for you the word impossible doesn't exist," said Perez.
"Without any doubt Zidane is one of the greatest figures in the history of football."
Right from the start of his reign in June, Benitez struggled to gain the respect of Madrid's star-studded squad with many senior players voicing their displeasure at the sacking of his predecessor Ancelotti.
A run of three league defeats in five games in November and December, including a 4-0 thrashing at home to Barcelona, wiped away the early credit Benitez had gained with an unbeaten 14-game run to start his reign.
Further embarrassment was to follow when Madrid were thrown out of the Copa del Rey for fielding an ineligible player last month.
And captain Sergio Ramos failed to offer a strong sign of support for Benitez when given the chance after the Valencia game.
"His future doesn't depend on us," said the Spanish international.
"Whoever the coach is he will always have the confidence of the players. Whether it is Rafa or anyone else."