(Reuters) - Kraft Foods Group Inc (KRFT.O), maker of Velveeta cheese and Oscar Mayer meats, is in talks to be acquired by Brazilian private equity firm 3G Capital, a source familiar with the matter told Reuters on Tuesday.

3G teamed up with Warren Buffett's Berkshire Hathaway Inc (BRKa.N) to acquire Ketchup maker H.J. Heinz Co for $23.2 billion two years ago. 3G is now expected to merge Kraft with Heinz if it clinches a deal.

Buffett had said in May he expected to work with 3G on more transactions.

Shares of Kraft, which is battling sluggish demand for packaged food products in the United States, rose as much as 16.5 percent to $71.44 in trading after the bell.

The Wall Street Journal first reported on the possible deal and said Kraft may be valued at $40 billion.

Kraft had 588.13 million shares outstanding as of March 2, according to Thomson Reuters data. Based on Tuesday's close of $61.32, Kraft had a market capitalization of $36.06 billion.

3G Capital, Berkshire and Kraft were not available for comment outside regular U.S. business hours.

The Brazilian private equity firm is looking at new acquisition targets after investors pledged about $5 billion to form a new takeover fund, the Journal had reported in January.

3G Capital has been criticized in the past for its decision to cut thousands of jobs at Heinz.

Four months following Berkshire and 3G Capital's takeover of Heinz, 11 of the top 12 Heinz executives were replaced. This was followed by a series of layoffs.

In December, Kraft said its Chairman John Cahill would replace the chief executive officer, which was followed by a series of management reshuffles.

The company reported a loss for the fourth quarter as consumers' move toward fresher foods with higher quality ingredients affected its earnings.

Unlike some of its peers, Kraft has stayed away from expanding into faster-growing areas such as natural and organic foods through acquisitions.

Cahill, who has declined to give specifics on his strategy, is now turning the company's focus on developing products based on consumer insights and spending on more efficient advertising.

Kraft split into two companies in 2012, with Kraft Foods focusing on grocery products in North America and Mondelez International Inc (MDLZ.O) on snack products.