Warren Buffett is finally getting into the burger business.

Buffett’s Berkshire Hathaway brk.a has agreed to help finance Burger King’s BKW purchase of Canadian coffee-and-doughnut chain Tim Hortons THI .

The deal, first reported by The Wall Street Journal, was officially announced Tuesday morning. The two companies said they have agreed to merge, bringing together Burger King, which is majority-owned by Brazilian private equity firm 3G Capital, and Tim Hortons, creating an $18 billion quick-serve restaurant behemoth.

The two companies said that Tim Hortons shareholders will receive C$65.50 in cash and 0.8025 shares of the new, combined company for each Tim Hortons share they currently own. When the deal is closed, 3G Capital will own about 51% of the combined company.

Berkshire is not expected to purchase common stock in the combined company, but instead is helping to finance the deal — alongside J.P. Morgan Chase & Co. and Wells Fargo — in exchange for preferred stock that would pay out an annual dividend.

Buffett worked with Brazil’s 3G Group last year to purchase ketchup-maker H.J. Heinz Co.

According to a source familiar with the situation, 3G reached out to Buffett back in 2010 about partnering on its original takeover of Burger King, but he demurred (although he already was in the quick-serve food biz via Berkshire’s ownership of Dairy Queen). Among Buffett’s concerns about Burger King were a succession of failed CEOs and the seeming invincibility of McDonald’s. Since then, Burger King’s revenue has consistently declined during 3G’s ownership (in large part due to its divestiture of company-owned stores), although both its profits and EBITDA have increased (3G is known for its focus on cutting costs). The company’s stock also is up more than 100% since returning to the public markets in June 2012.

By coming aboard now, however, Buffett may be hopping atop a political powder keg.

Burger King plans to relocate its headquarters from Florida to Ontario following the deal, making it just the latest in a series of so-called “tax inversions” that allow acquiring U.S. companies to lower their tax bills. Canada’s corporate tax rate is just 26.5%, compared to the U.S. rate of 35%. Burger King still would be required to pay U.S. taxes on U.S. operations, but ultimately would enjoy a lower IRS bill than were it to officially remain in Miami (in a strange twist, Tim Hortons had been incorporated in Delaware before later ‘self-inverting’). Approximately 44% of Burger King’s 2013 revenue came from outside the U.S.

Most of the political pressure to change tax law to prevent inversions has come from Democrats, with President Obama publicly denouncing such transactions. So it should be interesting to see if Buffett’s participation in Burger King either causes Democrats to back off, or possibly gets Republicans on board with existing reform efforts.

For his part, Buffett has said that he does not believe U.S. companies are unduly burdened by taxes, but he does see irrationality in the tax code and would prefer more consistency in corporate rates from country to country. Perhaps what he would argue is that Burger King and Tim Hortons will grow larger in the U.S. as a combined company than as separate entities, thus ultimately generating more U.S. tax revenue.

Under terms of the agreement, Burger King cannot walk away just because U.S. tax law changes. Also, Berkshire would be expected to pay U.S. taxes on its dividend income at a full rate, without the dividend received deduction that benefits holders of preferred shares of U.S.-based companies.