It is a welcome boost for the 26-year-old England international, whose career has been hampered by injury.
He missed the end of last season after needing surgery on a ruptured ligament in his right thumb.
Foster was forced to miss the title run-in and the Champions League final defeat by Barcelona because of his injury. He also sat out England's World Cup qualifiers in June.
Manager Sir Alex Ferguson said: "We are delighted that Ben has signed a new four-year deal.
"Ben is seen as one of the best young goalkeepers in England and we genuinely see him as a successor to Edwin van der Sar."
Foster remains determined to claim the number one spot when Van der Sar decides to retire but knows he faces stiff competition from Polish shot-stopper Tomasz Kuszczak.
He said: "I'm really happy to commit my future to the club.
The spirit here is fantastic and working along side Edwin and Tomasz has been a great influence."
Foster has made only 10 appearances for United after arriving in July 2005 from Stoke.
However he took his chance on the big stage in March when his penalty shoot-out heroics helped the club defeat Tottenham and lift the Carling Cup.
It took Foster almost three years to make his competitive United debut - he was outstanding in a 1-0 win over Derby in 2008.
No sooner had he arrived at United he was farmed out to Watford and helped them win promotion to the Barclays Premier League.
He stayed at Vicarage Road the following season and made his debut for England in the 1-0 defeat against Spain in a friendly at Old Trafford in 2007.
Foster then returned to United but had to undergo cruciate knee ligament surgery, ruling him out for almost a year.
Meanwhile, United look to have won the race for France Under-21 star Obertan, who has been also been linked with Inter Milan, AC Milan and Arsenal.
Reports in France say that a £3million fee has been agreed and that Obertan will sign a four-year contract.
Bordeaux sent him on loan for the second half of last season to Lorient where he made 15 appearances, scoring one goal.
Club president Jean-Louis Triaud stated yesterday that it was a "great possibility" United would sign Obertan.
Obertan scored against England U21 in March and took the Most Valuable Player award at last month's Toulon International youth tournament.