NEW YORK -- Billionaire Warren Buffett, the most closely watched investor in America, is putting his money in ketchup, agreeing to buy H.J. Heinz Co. for $23.3 billion in the richest deal ever in the food industry.For his money, the Oracle of Omaha gets one of the nation's oldest and most familiar brands, one that's in refrigerators and kitchen cupboards all over the U.S.The deal is intended to help Heinz accelerate its expansion from a dominant American name into a presence on grocery shelves worldwide. The Pittsburgh company also makes Classico pasta sauces and Ore-Ida potatoes, and a growing stable of sauces suited to regional tastes worldwide.Buffett's investment firm, Berkshire Hathaway, is teaming with investment firm 3G Capital to snap up Heinz, which had long been a subject of takeover speculation. New York-based 3G is best known for its acquisitions of Burger King and its role in the deals that created Anheuser-Busch InBev, the world's biggest beermaker.The deal, expected to close in the third quarter, sent shares of Heinz soaring. The company's stock price was up nearly 20 percent at $72.45 in afternoon trading on the New York Stock Exchange.Berkshire picked up steam, too. Its Class A shares gained $1,490, or about 1 percent, to close Thursday at $149,240.Buffett said recently that he's been hunting for elephant-sized deals. At the end of last year, he said on CNBC that he had about $47 billion in cash available.Berkshire's biggest acquisition ever was its $26.3 billion purchase of Fort Worth-based Burlington Northern Santa Fe railroad in 2010. In Fort Worth, Berkshire also owns TTI, Justin Brands and Acme Brick.Last year, Buffett started building a newspaper company with the $149 million acquisition of 63 Media General newspapers and several other small and midsize newspapers. Berkshire now owns 28 dailies and a number of other publications.Berkshire's real estate unit also bought the Prudential and Real Living real estate franchises nationwide last fall.The plans to take Heinz private apparently began to take shape on a plane in early December. In an interview with CNBC, Buffett said he was approached at that time by Jorge Lemann, a fellow billionaire and a co-founder of 3G.The two had known each other since serving on the board of Gillette about 12 years ago.Soon after that encounter, two of 3G's managing partners traveled to Pittsburgh to have lunch with Heinz CEO William Johnson and raise the prospect of buying the 144-year-old company."The offer was such that I simply felt compelled to take it to my board," Johnson said at a news conference Thursday.For several weeks, Johnson said, the board worked out details of the transaction.Berkshire is putting up $12.12 billion in return for half of the equity in Heinz, as well as $8 billion of preferred shares that pay 9 percent, according to a filing with the Securities and Exchange Commission. 3G Capital will run Heinz, and Berkshire will be the financing partner.