The Scot, 71, has won 38 trophies during his reign at Old Trafford and will now become a director and ambassador for the club.
His haul includes 13 league titles, two Champions League crowns, five FA Cups and four League Cups.
“The decision to retire is one that I have thought a great deal about. It is the right time,” Ferguson said.
Man United’s 20 league titles
Everton’s David Moyes is the bookmakers’ favourite to take over, with Jose Mourinho, currently at Real Madrid, also tipped.
BBC sports editor David Bond says United are confident of announcing a successor to Ferguson before the weekend.
He believes they are looking for someone who understands the club’s history and is committed to youth development while employing an attractive, attacking style of football.
While United look for his successor, tributes to Ferguson have been led by Prime Minister David Cameron, whotweeted: “Sir Alex Ferguson’s achievement at #MUFC has been exceptional.”
Former Manchester United and England striker Michael Owen says the Scot’s managerial record will “surely never be eclipsed”.
- Ferguson believes the squad he leaves behind “bodes well for continued success”.
- His final game will be against West Brom and will be his 1500th in charge at United.
- United co-chairman Joel Glazer says: “His determination to succeed and dedication to the club have been truly remarkable.”
- Chief executive David Gill says: “What he has done for this club and for the game in general will never be forgotten.”
Ferguson, who will undergo hip surgery in the summer, is confident his successor will take over a club in good health after winning their 20th top-flight title 17 days ago.
“It was important to me to leave an organisation in the strongest possible shape and I believe I have done so,” he 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 set-up will ensure that the long-term future of the club remains a bright one.”
Ferguson’s Man Utd trophies
Premier League: 1993, 1994, 1996, 1997, 1999, 2000, 2001, 2003, 2007, 2008, 2009, 2011, 2013.
FA Cup: 1990, 1994, 1996, 1999, 2004
League Cup: 1992, 2006, 2009, 2010
Champions League: 1999, 2008
Cup Winners Cup: 1991
Fifa Club World Cup: 2008
Uefa Super Cup: 1992
Inter-Continental Cup: 1999
FA Charity/Community Shield: 1990 (shared), 1993, 1994, 1996, 1997, 2003, 2007, 2008, 2010, 2011
Ferguson praised the people he felt helped him build the club from a team that had not won a title for 26 years into one of the biggest in the world.
“I must pay tribute to my family, their love and support has been essential,” he added. “My wife, Cathy, has been the key figure throughout my career, providing a bedrock of both stability and encouragement. Words are not enough to express what this has meant to me.
“As for my players and staff, past and present, I would like to thank them all for a 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.
“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.
“Over the past decade, the Glazer family have provided me with the platform to manage Manchester United to the best of my ability and I have been extremely fortunate to have worked with a talented and trustworthy chief executive in David Gill. I am truly grateful to all of them.
“To the fans, thank you. The support you have provided over the years has been truly humbling. It has been an honour and an enormous privilege to have had the opportunity to lead your club and I have treasured my time as manager of Manchester United.”
Ferguson is the most successful manager in the history of the British game and famously won the Premier League, FA Cup and Champions League in 1999.
Co-chairman Joel Glazer highlighted Ferguson’s desire to produce winning teams throughout his time at United and called the 2008 Champions League victory over Chelsea in Moscow a “magical night”.
He said: “Alex has proven time and time again what a fantastic manager he is, but he’s also a wonderful person. His determination to succeed and dedication to the club have been truly remarkable.
“I will always cherish the wonderful memories he has given us, like that magical night in Moscow.”
Fellow co-chairman Avie Glazer expressed how important the United board felt it was to ensure Ferguson continued working for the club despite his decision to step down as manager.
Archive: Rollercoaster of success
“I am delighted to announce that Alex has agreed to stay with the club as a director,” he said. “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.”
Gill, who is also stepping down this summer after 16 years at United, revealed Ferguson had been planning to make his succession easier by putting in place a young squad and a state-of-the-art training facility at Carrington.
He said: “I’ve had the tremendous pleasure of working very closely with Alex for 16 unforgettable years – through the treble, the double, countless trophy wins and numerous signings.
“We knew that his retirement would come one day and we both have been planning for it by ensuring the quality of the squad and club structures are in first-class condition.
“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.
“The way he cares for this club, his staff and for the football family in general is something that I admire. It is a side to him that is often hidden from public view but it is something that I have been privileged to witness in the last 16 years.
“What he has done for this club and for the game in general will never be forgotten. It has been the greatest experience of my working life being alongside Alex and a great honour to be able to call him a friend.”
Ferguson began his playing career at Queen’s Park as a 16-year-old striker whilst working as an apprentice tool-worker at Clyde Shipyards.
Ferguson in numbers
1: Knighthood from the Queen in June 1999
2: Champions League titles against Bayern Munich in 1999 and Chelsea in 2008
5: Teams managed by Ferguson – East Stirling 1974, St Mirren 1975-78, Aberdeen 1978-1986, Scotland 1985-86, Man Utd 1986-2013
6: Clubs as a player – Queen’s Park, St Johnstone, Dunfermline, Rangers, Falkirk, Ayr
9: Scottish and English FA Cup titles
17: Games missed due to touchline bans.
26: Years since United had won the title before Ferguson’s triumph in 1993
38: Trophies won at Old Trafford
49: Trophies won as a manager with Manchester United, Aberdeen and St Mirren.
104: Players bought while at Manchester United. The last was Wilfried Zaha, signed from Crystal Palace for fee rising to £15m in January and loaned back to Palace.
170: Goals scored during his playing career
370: Appearances as a player
1498: Games at Manchester United, with 894 wins, 337 draws and 267 defeats
His most notable spell as a player came in a two-year stint at Glasgow Rangers from 1967. He retired as a player in 1974 when he was on Ayr United’s books.
He began his managerial career as a 32-year-old at East Stirlingshire before moving to St Mirren, where he won his first trophy by taking the Scottish first division title in 1977.
Ferguson’s talent at building winning teams became apparent after he took over at unfashionable Aberdeen and turned them into a major force in a league where Rangers and Celtic had dominated.
His crowning moment was winning the European Cup Winners’ Cup in 1983 by beating Real Madrid 2-1 in the final
He also won three Scottish titles, four Scottish FA Cups and one League Cup during his time at Pittodrie and that success saw him land the United job, taking over from Ron Atkinson on 6 November 1986.
Ferguson had managed Scotland in the World Cup in Mexico earlier that year following the death of Jock Stein although he was unable to take his country past the group stages.
Current Blackpool manager Paul Ince won two league titles, two FA Cups, a European Cup Winners’ Cup medal and a League Cup during his time playing for Ferguson at United.
He told Sky Sports News: “I’m totally shocked. What he’s done is unbelievable. You’ll never see anyone of his kind again.
“Two weeks ago he was talking about staying on for another two years, so it’s a massive, massive shock.
“The man was immense and he got the best out of me that’s for sure. The way he treated me was like a son.”
Ferguson told his players he was stepping down before training today as they prepare for Sunday’s match against Swansea. It will be the Scot’s final home game as manager of the Premier League champions.
First-team coach Rene Meulensteen said: “He told us just this morning. He called us in his office and told us the decision he had taken. I think he is feeling a sense of relief in some ways now.”
Owen feels taking over from Ferguson is going to be a difficult job.
He tweeted: “What an act to follow. I guess only Mourinho would have the confidence to strut through the door. If it were me, I’d go for Moyes.”