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

The Berkshire Hathaway Inc. BRK.B, +0.07% 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.