Rumours about the 71-year-old's United future began to circulate at the club's golf day on Tuesday with United finally making the announcement on their website that English football's most successful manager will call time on a 26-and-a-half-year reign this summer.
Ferguson's decision comes just days after he secured his 13th Premier League title, and he also delivered United two European Cups, five FA Cups, four League Cups and a European Cup Winners' Cup.
He will stay on at Old Trafford as a director and a club ambassador.
In a statement, Ferguson said: "The decision to retire is one that I have thought a great deal about and one that I have not taken lightly. It is the right time.
"It was important to me to leave an organisation in the strongest possible shape and I believe I have done so. 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.
"Our training facilities are amongst the finest in global sport and our home Old Trafford is rightfully regarded as one of the leading venues in the world.
"Going forward, I am delighted to take on the roles of both Director and Ambassador for the club. With these activities, along with my many other interests, I am looking forward to the future.
"I must pay tribute to my family, their love and support has been essential. 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."
Manchester United chief executive David Gill has described his time with Ferguson as the "greatest experience" of his working life.
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."
Manchester United joint-chairman Joel Glazer says he will cherish Ferguson's glory years, and picked out the Champions League success in 2008 as his highlight.
"Alex has proven time and time again what a fantastic manager he is but he's also a wonderful person," Glazer said.
"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."
United are now looking for a new manager and Everton boss David Moyes has emerged as a frontrunner to succeed Ferguson, Sky sources understand.
Former United goalkeeper Peter Schmeichel believes Moyes could provide the stability needed when Ferguson steps down.
He said: "David Moyes has been more than a decade at Everton on limited funds and he's been doing a fantastic job. He's Scottish, he's made from the same cloth as Sir Alex."