Manchester - Wayne Rooney performed a shock u-turn Friday by signing a new five-year contract with Manchester United just days after appearing to be on his way out of Old Trafford.GALLERY: The wrath of Sir Alex FergusonVIDEO: Sir Alex Ferguson confirms Rooney's leavingVIDEO: Manchester United's in-flight anticsRooney 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."Rooney, who was reportedly demanding wages of around 150 000 pounds a week after tax in the original contract negotiations, insisted he agreed the new deal because Sir Alex Ferguson had convinced him United remain committed to succeeding on the pitch."I am delighted to sign another deal at United," he said. "In the last couple of days, I have talked to the manager and the owners and they have convinced me this is where I belong."I said on Wednesday the manager is a genius and it is his belief and support that have convinced me to stay."I'm signing a new deal in the absolute belief that the management, coaching staff, board and owners are totally committed to making sure United maintains its proud winning history - which is the reason I joined the Club in the first place."United manager 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's comments about Rooney's failure to show respect for United seemed to signal a breakdown in their relationship, especially as it came after a war of words between the two over the United manager's decision to rest his star for three matches due to an ankle injury.But Ferguson said 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.Rooney's decision to stay is sure to be greeted with relief by most United fans, but several of the club's players, including Patrice Evra, had already expressed frustration at the situation.His form in recent months had been well below-par as well and it remains to be seen if he will be welcomed back in the dressing room.However, Ferguson is confident Rooney can go on to become one of United's all-time greats."I'm pleased he has accepted the challenge to guide the younger players and establish himself as one of United’s great players," he said.Rooney has no doubts he can regain the trust of United's supporters and he added: "I'm sure the fans over the last week have felt let down by what they've read and seen. But my position was from concern over the future."The fans have been brilliant with me since I arrived and it's up to me through my performances to win them over again."Wayne Rooney factfile:Born: October 24, 1985Birthplace: LiverpoolAugust 2002 - Makes Premier League debut in Everton's 2-2 draw at Southampton.October 2002 - Scores first goals at senior level with two in 3-0 League Cup win at Wrexham.October 2002 - Nets first Premier League goal with stunning late winner as Everton beat Arsenal at Goodison Park.February 2003 - Becomes youngest player to win a full England cap when he appears as a second-half substitute against Australia.September 2003 - At 17 years and 317 days, becomes England's youngest goalscorer with equaliser in match in Macedonia.August 2004 - Signs for Manchester United for 27 million pounds.September 2004 - Scores a stunning hat-trick - his first senior treble - in a 6-2 victory over Fenerbahce in the Champions League, on his United debut.February 2006 - Scores twice as United beat Wigan 4-0 in League Cup final at Cardiff's Millennium Stadium, Rooney's first senior trophy.July 2006 - Sent off in the World Cup quarter-final against Portugal after appearing to stamp on the groin of Ricardo Carvalho and then push Manchester United team-mate Cristiano Ronaldo.May 2007 - Earns first Premier League winners medal as United are confirmed as champions.May 2008 - Helps United retain Premier League title.August 2009 - Scores his 100th United goal against Wigan.April 2009 - Named Professional Footballers' Association Player of the Year. and Football Writers' Association Player of the Year as United take title again.September 2010 - Lurid newspaper allegations over Rooney's private life are printed.October 2010 - Ferguson confirms reports that Rooney has declined a new deal and wants to leave United, also suggesting he had not respected the club.October 2010 - Rooney issues a statement confirming his desire to leave: "I met with (chief executive) David Gill last week and he did not give me any of the assurances I was seeking about the future squad".October 2010 - Signs a new five-year contract with the club.