Manchester United has confirmed that David Moyes will replace Sir Alex Ferguson as the club’s manager after handing him a six-year contract.

Everton coach Moyes, who announced earlier he would be leaving the club after 11 years in charge, was favourite to take over from his fellow Scot at United and will take up his new role from July 1.

“When we discussed the candidates that we felt had the right attributes we unanimously agreed on David Moyes,” Ferguson, who is staying at United as an ambassador and director, said in a statement.

“David is a man of great integrity with a strong work ethic. I’ve admired his work for a long time and approached him as far back as 1998 to discuss the position of assistant manager here.

“He was a young man then at the start of his career and has since gone on to do a magnificent job at Everton. There is no question he has all the qualities we expect of a manager at this club.”

Moyes is braced for the tough job of following Britain’s most successful manager, who is retiring at the end of the season after winning two Champions Leagues, 13 league titles, and five FA Cups in more than 26 years at United.

“It’s a great honour to be asked to be the next manager of Manchester United,” Moyes said.

“I am delighted that Sir Alex saw fit to recommend me for the job. I have great respect for everything he has done and for the football club.

“I know how hard it will be to follow the best manager ever, but the opportunity to manage Manchester United isn’t something that comes around very often and I’m really looking forward to taking up the post next season.”

Moyes will remain in charge for Everton’s final two Premier League games of the season against West Ham United and Chelsea.

“Between now and the end of the season, I will do everything in my power to make sure we finish as high as possible in the table,” he said.

Moyes is a Champions League novice, having only once guided Everton to a place in Europe’s elite competition although they never reached the group stage, going out 4-2 on aggregate to Villarreal in the third qualifying round in 2005-06.