Manchester United assistant coach Carlos Queiroz has agreed a two-year deal to take over at Real Madrid.
Queiroz will be officially named at a news conference in Madrid on Wednesday evening.
Queiroz was Real's first choice after the ruthless sacking of Vicente del Bosque - and he has confessed it is a "once in a lifetime" opportunity.
Queiroz held talks with Real's sporting director Jorge Valdano on Tuesday and quickly agreed a contract.
And Manchester United boss Sir Alex Ferguson prepared the ground for the Mozambique-born coach's departure.
He said: "This is a wonderful opportunity for him, too big a chance to turn down.
"But we won't be in a rush to appoint a new coach. I have been very satisfied with the job that Mike Phelan has been doing on our coaching staff."
Queiroz said: "This year has been very fruitful and I'm very grateful to Sir Alex Feguson. I don't want to leave Manchester United on bad terms.
"The Madrid offer is like one of those trains which comes along once in your lifetime that you have to take."
A statement released by Manchester United said: "We thank Carlos for his contribution to Manchester United's success last
season and wish him well in his new job.
"A replacement for Carlos will be sought in due course."
He must unite a club divided after fans and players reacted angrily to the dismissal of Del Bosque and club captain Fernando Hierro was told his contract would not be renewed.
Queiroz, 53, joined Manchester United at the start of last season and helped Sir Alex Ferguson bring the Premiership title back to Old Trafford.
It will mean a swift reunion with England captain David Beckham, who will formally complete a £25m move to Real Madrid at the start of July.
Queiroz, a close friend of Luis Figo, was formerly coach of Portugal, Sporting Lisbon and South Africa.
Having guided South Africa to the 2002 World Cup finals, he quit and joined United last summer.