The team has been powered by Renault since changing from Cosworth units at the start of the 2012 season, but has opted to do a deal with the German manufacturer for the new 1.6-litre V6 turbo era.
The announcement is the latest in a flurry of moves in the F1 engine market for 2014, with teams rushing to tie up supply deals.
As part of the deal, Mercedes will supply all associated energy recovery systems for the power unit, although Williams will continue to design and produce its own transmission.
"I'm delighted to announce our new association with Mercedes-Benz for the 2014 Formula 1 season and beyond," said team principal Frank Williams.
"Mercedes-Benz has been one of the sport's most successful engine suppliers and we believe that they will have an extremely competitive engine package.
"I would also like to take this opportunity to thank Renault for their continued hard work since we renewed our engine partnership at the beginning of the 2012 season.
"We have enjoyed a strong relationship that has resulted in much success over the years, including powering us to winning ways once again last year at the Spanish Grand Prix."
Deputy team principal Claire Williams believes that the Mercedes engine deal is crucial for the future success of the team.
"The announcement of this partnership is exciting news for Williams," she said.
"Securing the right engine supply partnership is a key milestone in the implementation of our strategy for long-term success.
"We are also pleased to conclude this agreement early in the season and we very much look forward to working with Mercedes in developing our 2014 race car."
Renault has only confirmed two engine supply deals for next year, announcing in Monaco that Scuderia Toro Rosso would be switching from Ferrari.
It will also continue to supply Caterham, although an official announcement has yet to be made.
Speaking in Monaco, Renault president Carlos Ghosn confirmed that three partner teams is its minimum, although there could be more deals for next year with Lotus known to be in talks with it.
"We need three teams, this is the minimum," said Ghosn.
"We would not be surprised that a third one will come soon and we may have more, but we don't need more.
"We may have four, we may have up to five teams but this is more a question of opportunity than necessity."
Williams has chopped and changed its engine supplier more than any other team over the past decade.
Anglo-German alliance yielded 10 victories and almost the 2003 world championship. Partnership came to an end when BMW wanted to get involved in team ownership, which was not possible with Williams, leading to it buying Sauber.
Much was expected of the high-revving Cosworth powerplant at the start of the 2.4-litre V8 era, but the season was bitterly disappointing. Williams managed only 11 points and eighth in the constructors' championship.
There were moments of promise for the partnership, notably fourth place (after McLaren's exclusion) in the 2007 constructors' standings. But there were only three podiums, and no victories, in three years together.
Nico Hulkenberg's sensational pole position at Interlagos in 2010 was the high point for this renewed alliance, but the 2011 season was the worst since Williams Grand Prix Engineering's first season running March chassis in 1977.
Renault power was widely hailed as one of the key reasons for Pastor Maldonado being able to end the team's win drought last year. But Williams has slumped this season and has yet to score a point in six races.