The 76-year-old, hailed as one of the most successful football managers ever, will now require a period of "intensive care" to help his recovery, his former club said, adding that the surgery had gone "very well".
Football fans have set allegiances aside to unite in sending their best wishes to Sir Alex and his family.
In a statement Manchester United said: "Sir Alex Ferguson has undergone surgery today for a brain haemorrhage.
"The procedure has gone very well but he needs a period of intensive care to aid his recovery. His family request privacy in this matter.
"Everyone at Manchester United sends our very best wishes."
Sir Alex's son Darren, manager of League One side Doncaster, did not attend his side's final home game of the season against Wigan due to his father's illness.
Arch United rivals Manchester City joined other clubs, some using the hashtag football family, to wish Sir Alex well.
Manchester City tweeted: "Everyone at Manchester City wishes Sir Alex Ferguson a full and speedy recovery after his surgery."
Anfield HQ tweeted: "A great rival but also a great friend who supported this club during its most difficult time, it is hoped that Sir Alex will make a full recovery."
Aberdeen Football club, which Sir Alex helped to break the Celtic and Rangers dominance of Scottish football before he went on to manage Manchester United, also wished him well.
The club tweeted: "The thoughts and prayers of everyone connected with Aberdeen Football Club are with our former manager, Sir Alex Ferguson and his family following tonight's news."
United midfielder Michael Carrick said he was "absolutely devastated" to hear Sir Alex was ill.
He added: "All my thoughts and prayers are with him and his family. Be strong Boss."
Former United striker Mark Hughes, speaking after his Southampton side's draw with Everton, said: "I wish him all the best."
Former Liverpool great Robbie Fowler tweeted: "Wishing Sir Alex Ferguson a full and speedy recovery following his emergency surgery today."
Scotland's First Minister and SNP leader Nicola Sturgeon joined Scottish Tory leader Ruth Davidson in tweeting their best wishes for Sir Alex.
Television presenter Eamonn Holmes, a longtime friend of the football hero and fervent Manchester United fan, described him as an "amazing man".
He tweeted: "Praying for The Boss that he makes a full recovery from his Brain Haemorrhage. So much part of my life personally and professionally for over 30 years. An amazing man and friend. #MUFC"
Luke Griggs, of the brain injury charity Headway, said a brain haemorrhage can occur spontaneously as a result of a ruptured aneurysm, or from a blow to the head, even a minor head injury.
He added: "It can be extremely serious and require urgent medical intervention, however the long-term implications are very difficult to predict.
"Every brain injury is unique, as is every individual's recovery."
Former goalkeeper Edwin van der Sar, whose wife Annemarie van Kesteren suffered a brain haemorrhage in 2009 but later recovered.
He tweeted: "Devasted about the news about Sir Alex and knowing all to well about the situation ourselves. Stay strong and hope together with everyone you recover. Edwin & Annemarie"
Former United player David Beckham posted a picture on Instagram of himself as a fresh-faced schoolboy with Sir Alex, writing: "Keep fighting Boss.. Sending prayers and love to Cathy and the whole family."
Sir Alex retired in 2013 as one of the most successful football managers of all time when he made the bombshell announcement he was leaving after 26 years at the helm of the Old Trafford club.
During that time he took the club to the pinnacle of the English and European game and the decision saw United's shares go down 5% on the New York Stock Exchange amid worries over whether the club can find the right replacement.
With his uncompromising "hairdryer treatment" style of management, he led
United to 13 Premier League titles, two Champions League crowns, five FA Cups and four League Cups.
He also won the treble of Premier League, FA Cup and Champions League in 1999, the year in which he was knighted.
Born into a family of shipyard workers in the Govan area of Glasgow, Sir Alex has been a well-known Labour supporter and had been named in the past as one of the party's biggest donors.