"The decision to retire is one that I have thought a great deal about and one that I have not taken lightly," the 71-year-old Scotsman said in a statement on Wednesday. "It is the right time."
The club, which is owned by the American Glazer family and listed on the New York Stock Exchange, did not immediately announce a successor, but will need to act swiftly to stave off any market uncertainty.
Ferguson's compatriot, Everton manager David Moyes, is out of contract at the end of the season and quickly emerged as the front-runner.
During 11 years at Everton, Moyes has overseen impressive consistency on a limited budget, and has a long-standing friendship with Ferguson.
"He is a first-class manager," Ferguson, who is being consulted on his successor, said of Moyes last year.
Few managers at United -- or anywhere in global football -- will come close to matching Ferguson's achievements.
Since taking charge at Old Trafford in 1986, Ferguson has won a total of 38 trophies, including 13 Premier League championships, two Champions League titles and five FA Cups.
"It was important to me to leave an organization in the strongest possible shape and I believe I have done so," Ferguson said. "The quality of this league winning squad, and the balance of ages within it, bodes well for continued success at the highest level whilst the structure of the youth setup will ensure that the long-term future of the club remains a bright one."
Ferguson reversed a previous plan to retire at the end of the 2001-02 season.
After United secured its latest Premier League title two weeks ago -- extending the club's record English championship haul to 20 -- Ferguson declared that he had no retirement thoughts. But now he has just two more league matches left in charge.
United's last home game -- a chance for fans to pay an emotional farewell to Ferguson -- is against Swansea on May 12. United then travels to West Bromwich Albion a week later in the final match for the man who has turned the club into one of the world's biggest sports powers
"His drive, ambition, skill, passion and vision have not only shaped Manchester United, but in many ways the game of football as we now know it," Premier League chief executive Richard Scudamore said.
Ferguson has previously said only health problems would force him to relinquish the job, and it emerged over the weekend that he requires hip surgery. However, the retirement statement did not mention health issues.
Ferguson will continue to loom large at United as he will remain as a club director and ambassador.
"His contributions to Manchester United over the last 26 years have been extraordinary and, like all United fans, I want him to be a part of its future," joint chairman Avie Glazer said.
Talk of Ferguson leaving first surfaced following the club's golf day on Tuesday. When the official announcement came it prompted an outpouring of tributes from inside and outside the game.
FIFA President Sepp Blatter said on Twitter that Ferguson's "achievements in the game place him without doubt as one of the `greats'."
UEFA President Michel Platini hailed Ferguson as a "true visionary."
"His CV is almost unique in a results-based profession that normally focuses on short-term solutions rather than long-term vision," the former France star said.
The announcement even grabbed the British media spotlight from the buildup to the State Opening of Parliament, where Queen Elizabeth II, who knighted Ferguson in 1999, was setting out the government's planned legislation.
Ferguson has played a high-profile role campaigning for the Labour Party.
"Proud man. Great manager. Staunch Labour Party supporter," Labour Party leader Ed Miliband tweeted. "Sir Alex Ferguson will never be forgotten."
Tributes crossed the political divide, with Sports Minister Hugh Robertson, a member of the Conservative Party, praising Ferguson for his "enthusiasm for our national game."
Ferguson has defined the modern era of success at United, resuscitating the fortunes of a club that was floundering when he arrived more than a quarter of a century ago, having won a European title at modest Aberdeen in Scotland.
While it took time for Ferguson to impose his leadership at Old Trafford, directors showed a degree of patience rarely afforded to current managers.
With his unwavering approach, Ferguson eventually produced his first trophy in 1990 -- the FA Cup -- and in 1993 the club won its first topflight title since 1967.
Since then, he has turned United into a European power and one of the world's wealthiest sports clubs. In addition to Champions League titles in 1999 and 2008, United has also won four League Cups and the 2008 FIFA Club World Cup.
"In my early years, the backing of the board, and Sir Bobby Charlton in particular, gave me the confidence and time to build a football club, rather than just a football team," Ferguson said. "Over the past decade, the Glazer family have provided me with the platform to manage Manchester United to the best of my ability."
Ferguson thanked his players for their "staggering level of professional conduct and dedication that has helped to deliver so many memorable triumphs."
"Without their contribution the history of this great club would not be as rich," Ferguson said.
Now United will have to plan for a future without Ferguson in the dugout.
"Alex's vision, energy and ability have built teams -- both on and off the pitch -- that his successor can count on as among the best and most loyal in world sport," United's chief executive David Gill said.
Gill told The Associated Press two weeks ago that Ferguson's successor would have to adapt to the existing squad and support team rather than making radical changes.
"The quality of the squad, the composition of that squad, means that any new manager coming in will inherit a great squad of players," Gill said. "And yes he may, whenever that is ... clearly want to bring in one or two of his own people, new players.
"But he won't want to change the squad wholesale because he won't be our manager."
Such a vision would point to the 51-year-old Moyes being hired over another manager being tipped by bookmakers, Real Madrid's Jose Mourinho.
"What we are looking for is not someone to come in (for) 10 months or three years, we want someone to come stay there and give stability," former United goalkeeper Peter Schmeichel said. "When we talk about Moyes, he has been a decade at Everton and done a fantastic job on limited funds."
Before United was listed on the NYSE last year, the club warned that a successor to Ferguson "may not be as successful."
"A downturn in the performance of our first team could adversely affect our ability to attract and retain coaches and players," United said in July.
More Sports Headlines
Snohomish mixed martial artist returns to her first love Mariners beat Twins 4-3 in 11 innings Charles scores 29 points, Liberty beat Storm 78-62 Park wins Women's British Open, captures 4th different major Perry wins 2nd straight Champions Tour's 3M Championship Merritt shoots 67 to win Quicken Loans National by 3 shots Triple Crown winner American Pharoah wins $1.75 million Haskell Invitational Bills' Ryan names Incognito starting left guard
Our new comment system is not supported in IE 7. Please upgrade your browser here.