Players had been told at Tuesday's golf day to expect a major announcement on Sunday, promoting speculation that he was set to step down after 27 years in charge.
Ferguson, who is 71, won his thirteenth league title this season. It had been reported earlier in the week that he requires a hip operation this summer that would possibly have meant him missing the start of next season.
He will stay on as a director and ambassador after a career that, after early struggles, brought two Champions League trophies, a Cup-Winners' Cup, five FA Cups and four League Cups to Old Trafford, as well as making United the most successful team in league history.
"The decision to retire is one that I have thought a great deal about and one that I have not taken lightly," Ferguson said in a statement. "It is the right time."