A United statement said the procedure “had gone very well” but Ferguson “needs a period of intensive care to optimise his recovery”.
The Scot, 76, retired as United manager in May 2013 after winning 38 trophies during 26 years in charge.
He was at Old Trafford last Sunday when he presented Arsenal boss Arsene Wenger with a commemorative trophy.
Ferguson’s family have requested privacy as he recovers in Salford Royal Hospital.
“We will keep Sir Alex and his loved ones in our thoughts during this time, and we are united in our wish to see him make a comfortable, speedy recovery,” United later said in a tweet.
The most successful manager in the history of the British game, Ferguson’s trophy haul at Old Trafford included 13 Premier League titles, two Champions League crowns, five FA Cups and four League Cups.
Ferguson famously won the Treble of Premier League, FA Cup and Champions League in 1999, the year in which he was knighted.
United’s club captain Michael Carrick said he was “devastated” to learn his former manager had needed emergency surgery.
“All my thoughts and prayers are with him and his family. Be strong boss,” he wrote on Twitter.
Ferguson has been married to wife Cathy since 1966. His son Darren manages Doncaster Rovers but did not not take charge of their League One match against Wigan on Saturday.
Ferguson began his playing career with Scottish club Queen’s Park as a 16-year-old striker whilst working as an apprentice tool-worker at Clyde Shipyards.
His most notable spell as a player came in a two-year stint at 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 going to St Mirren, where he won his first trophy by taking the Scottish first division title in 1977.
Ferguson moved on to Aberdeen and turned them into a major force in a Scottish top division in which Rangers and Celtic had dominated.
He led them to three Scottish titles, four Scottish FA Cups, one League Cup and the European Cup Winners’ Cup in 1983 by beating Real Madrid 2-1 in the final.