Ferguson, who is stepping down at the end of the season after nearly 27 years as United manager, jumped out of his seat and punched the air in delight after Rio Ferdinand volleyed the winning goal into the back of the net in the 86th minute.
Scholes played 66 minutes in his last home match before coming off to a standing ovation from more than 76,000 fans taking one final opportunity to salute a manager and player who have contributed so much to the club over the past three decades.
Javier Hernandez put United in front in the 39th before Michu equalized for Swansea 10 minutes later. But the match was effectively meaningless as United had already wrapped up its 13th Premier League title.
United still has one game left this season — at West Bromwich Albion next Sunday — but this was the final opportunity for the club's fans to witness, and savour, the end of a trophy-filled era overseen by Ferguson.
Both teams formed a guard of honour as Ferguson emerged from the tunnel onto the pitch, with a sea of red flags bearing "Champions 2013" providing an eye-catching backdrop. Rarely has Old Trafford hosted an atmosphere like this, and Ferguson was clearly emotional.
As Ferguson made his way to the dugout, waving to the crowd and signing a batch of autographs along the way, the focus of the majority of the crowd turned to the 38-year-old Scholes, who was playing his 717th match for United and first since the end of January because of a knee injury.
Zinedine Zidane and Xavi Hernandez are among the players past and present to describe Scholes as one of the greatest players of his generation, and the Englishman showed his full repertoire of skills. Scholes had one good chance to mark his final home match with a goal, but he dragged a shot straight at goalkeeper Gerhard Tremmel in the 23rd minute.
Scholes will end his career having played 17,606 Premier League minutes at Old Trafford since signing professional terms with the club in 1993.
By the time Scholes had jogged off to a standing ovation in the 66th minute, Hernandez had put United ahead with a low drive after a mistake by Swansea defender Ashley Williams. However, Michu equalized soon after the start of the second half by volleying in Nathan Dyer's right-wing cross.
With the game approaching what is widely known in British football as "Fergie Time" — coined due to the amount of injury-time goals scored by United in Ferguson's tenure that started in 1986 — an inswinging corner from Robin van Persie crept through to Ferdinand, who volleyed home amid a cacophony of noise for his first goal since January 2008.