England captain David Beckham has agreed a four-year contract with Real Madrid.
Manchester United confirmed to the London Stock Exchange on Wednesday that they will sell the 28-year-old midfielder to the Spanish giants for a fee of £24.5m.
A statement from the club said: "David Beckham has agreed personal terms with Real Madrid and expects to sign his new contract with the club on completion.
"The deal is expected to be completed in July, conditional upon approval by the boards of Manchester United and Real Madrid, and on the provision of satisfactory payment
"The proceeds of the sale will be used to support Manchester United's business development, including continuing to maintain its
playing success at the highest levels of the game."
Peter Kenyon, chief executive of Manchester United, said: "While we are sad to see David go after so many great years at Old Trafford, we believe this is a good deal for the club, and we now look forward to building on the success of last season's championship title.
"We wish David all the best in his new career in Spain and thank him for his fantastic contribution to the team's achievements in the last decade."
BREAKDOWN OF TRANSFER FEE
£5.25m on completion of Beckham's transfer
£12m in instalments over next four years
£7m based on Real's performances in Champions League (£875,000 every year they qualify, £875,000 every year they reach quarter-finals)
Beckham's future has been the source of intense media speculation in recent weeks, with a number of top clubs interested in capturing the player.
Barcelona had seemingly stolen the initiative over their Spanish rivals as well as the likes of AC Milan and Inter by agreeing a deal with Manchester United.
But Real Madrid, who initially denied they wanted to sign him, swooped late to lure Beckham to the Bernabeu, where he will play alongside superstars Zinedine Zidane, Luis Figo, Ronaldo and Raul.
Beckham is currently embarking on a tour of the Far East having just returned from the United States.
But he is expected to be unveiled at Real's headquarters on 2 July after undergoing a medical.
News of Beckham's move to Real Madrid will come as a bitter blow to fierce rivals Barca - and new president Joan Laporta in particular.
Laporta based his whole presidential campaign on his promise that he would bring the world's most high-profile footballer to the Nou Camp.
Manchester United are expected to step up their bid to bring Ronaldinho to Old Trafford and will use the rest of the money they receive for Beckham to strengthen their squad.