Moyes held talks with Everton chairman Bill Kenwright on Wednesday - a scheduled meeting - just hours after Sir Alex Ferguson's shock decision to stand down from his Old Trafford role after more than 26 years.
The Scot was quickly backed in to favourite to take over from Ferguson and confirmation arrived on Thursday afternoon that he would be leaving Goodison Park at the end of his contract in June, with a statement on the club's official website confirming he was keen to take over the Premier League title winners.
Moyes has been in charge at Everton since March 2002 when he took over from the sacked Walter Smith, helping them to escape relegation in his first few months.
Although he failed to bring any trophies to the club, Moyes secured European football for them on four occasions and often had to bring in players while operating under a tight budget.
The Everton statement read: "Everton can confirm that David Moyes will leave the club at the end of the season.
"The manager met chairman Bill Kenwright early yesterday evening (Wednesday 8th May) and confirmed his desire to join Manchester United.
"The chairman, on behalf of the club, would like to place on record his thanks to David for the massive contribution he has made to Everton since his arrival in March 2002. He has been an outstanding manager.
"During his tenure at Goodison Park, David has taken charge of the team on over 500 occasions including four European campaigns.
"His final two games as Everton Manager will be the remaining Premier League matches against West Ham United and Chelsea. Everton officials will start the search for a replacement manager immediately."
United's Facebook page earlier put up a picture welcoming Moyes to Old Trafford, but it was taken down sharply after spreading throughout the world of social media.