Including debt assumption, Heinz valued the deal at $28 billion, which it called the largest in food industry history.
For Buffett, the deal represents an unusual teaming with private equity for a major acquisition. He told CNBC that 3G approached him with the idea in December and that it was "my kind of deal."
He has been on the hunt for a major purchase, something worth $20 billion or more. Buffett said Thursday that Berkshire's piece of the Heinz purchase was $12 billion to $13 billion cash, for a mix of common and preferred equity.
Heinz said the deal would be financed with cash from Berkshire and 3G, debt rollover and debt financing from J.P. Morgan and Wells Fargo.
Buffett told CNBC that Berkshire and 3G would be equal equity partners.
The price represents a premium of 19 percent to Heinz's all-time high, and the stock actually rose above $72.50 in premarket trading. Buffett told CNBC that he would not pay more than that.
Heinz's shares soared 20 percent to $72.59 in premarket trading on the New York Stock Exchange.
Firms including Warren Buffett's to buy Heinz
(AP) H.J. Heinz Co. says it agreed to be acquired by an investment consortium including billionaire investor Warren Buffett in a deal valued at $28 billion.
The ketchup company says Heinz shareholders will receive $72.50 in cash for each share of common stock they own. The deal value includes the assumption of Heinz's debt. Based on Heinz's number of shares outstanding, the deal is worth $23.3 billion excluding debt.
"It's our kind of company,'' Buffett said in an interview on CNBC, noting its signature ketchup has been around for more than a century. "I've sampled it many times.''
Berkshire Hathaway and 3G Capital, the investment firm which also bought Burger King in 2010, say Heinz will remain headquartered in Pittsburgh.
Given the saturated North American market, Heinz has increasingly looked to emerging markets for growth. In its last quarter, the company said emerging markets made up 23 percent of sales.
The per-share price for the deal represents a 20 percent premium to Heinz's closing price of $60.48 on Wednesday. Buffett said Berkshire will still have room to make more acquisitions, noting that the firm's businesses continually replenish its cash supply.
"Anytime we see a deal is attractive and it's our kind of business and we've got the money, I'm ready to go,'' Buffet said.