The 30-year-old decided to extend the deal even though his existing contract still had two years to run.
"He has given us 16 great years of service and we are hoping his next four years are as good as his last four years," United manager Alex Ferguson told reporters on Friday.
"I think he has deserved our loyalty because he has given us plenty back."
Scholes has made 321 premier league appearances for United, scoring 87 times, since coming through the club's youth team to make his debut in the 1994-95 season and has helped the club win six league titles and three FA Cups.
He was also capped 66 times by England, scoring 14 goals, before retiring from international soccer following Euro2004.
United have secured the future of Scholes after defender Rio Ferdinand ended protracted contract talks by also signing a new four-year deal.
"It's absolutely brilliant. There was a lot of nonsense written about his (Ferdinand's) demands, which were million miles apart from what we were actually negotiating," said Ferguson.
"We are delighted that he has signed. With Darren Fletcher and John O'Shea agreeing deals also, and (Cristiano) Ronaldo very close to signing, we have a team that can stay together for four years now, which is fantastic for us."