Wayne Rooney performed a shock u-turn on Friday by signing a new five-year contract with Manchester United just days after appearing to be on his way out of Old Trafford.
Rooney had rocked United on Wednesday by revealing that he wanted to leave the Premier League club because they no longer had enough ambition to compete for major honours.
However United reopened talks with Rooney's agent and announced on Friday that the player had made an astonishing u-turn and opted to commit his long-term future to the club.
A statement on the club's website said: "Wayne Rooney has agreed a new five-year contract to stay at Manchester United until at least June 2015.
"The agreement follows intensive discussions between the Club and the player's representatives and means that by the end of his contract Wayne will have been a Manchester United player for 11 years."
United manager Sir Alex Ferguson had already revealed earlier in the week that contract talks with Rooney had broken down in August and it seemed certain the former Everton star would be sold.
Ferguson said on Friday he was delighted with Rooney's decision: "It's been a difficult week, but the intensity of the coverage is what we expect at Manchester United.
"I said to the boy that the door is always open and I'm delighted Wayne has agreed to stay.
"Sometimes, when you're in a club, it can be hard to realise just how big it is and it takes something like the events of the last few days to make you understand.
"I think Wayne now understands what a great club Manchester United is."
Rooney had been increasingly linked with a move to arch local rivals Manchester City, prompting an angry reaction from fans.
One group protested at his house on Thursday and had to be moved on by police.