Foster has been an ever-present for Nigel Pearson’s men in the top flight this season, appearing in all 29 league games and keeping nine clean sheets for the 17th placed team.
Foster’s previous deal was set to expire later in June, when he would have walked away as a free agent.
The 37-year-old former Manchester United and England goalkeeper is in his second spell at Watford.
“Goalkeeper Ben Foster has agreed a new two-year deal with Watford FC. A Premier League ever-present this season, the 37-year-old has made nearly 150 appearances in two spells with us,” Watford posted on Twitter.
He first joined the Hornets on loan for two seasons from Old Trafford in the 2005/2006 and 2006/2007 seasons.
Following spells at Birmingham City and West Bromwich Albion, Foster returned to Watford in the summer of 2018, and has since taken over from Heurelho Gomes as the club’s first choice goalkeeper.
Foster, who won eight caps for the England national team, has made 147 appearances in his two spells at Watford.
Watford will look to stave off the threat of relegation when the Premier League resumes, with their first game back from the enforced break coming against Champions League hopefuls Leicester City on June 20.