Investor Warren Buffett is helping finance Burger King Worldwide Inc.'s planned takeover of Canadian coffee-and-doughnut chain Tim Hortons Inc., according to people familiar with the matter, in a surprise twist that could add to investors" enthusiasm for the deal.

The Berkshire Hathaway Inc. chairman and chief executive would invest in the deal in the form of preferred shares, some of the people said. Berkshire is expected to provide about 25% of the deal's financing, one of the people said. The exact structure of Mr. Buffett's participation in the deal remains unclear, and the discussions are ongoing.

The takeover, likely valued at around $10 billion or more, could be announced in the next day or two, according to the people.

Shareholders cheered the potential tie-up Monday, after the companies confirmed they were in discussions, sending stock in both companies soaring nearly 20%. Mr. Buffett's participation in the deal may add to that enthusiasm given his reputation for shrewd investing.

Julie Jargon contributed to this article

Write to Dana Mattioli at dana.mattioli@wsj.com, David Benoit at david.benoit@wsj.com and Liz Hoffman at liz.hoffman@wsj.com

Subscribe to WSJ: http://online.wsj.com?mod=djnwires