The second-largest Kraft Heinz shareholder sold some of its position in the food company.

3G Capital sold 20.6 million shares in Kraft Heinz Tuesday at a price of $59.85 per share, bringing its stake down 7 percent to 270.1 million shares, according to a securities filing.

The private equity firm is the company's second largest shareholder after Warren Buffett's Berkshire Hathaway. After the sale, 3G Capital still has a 22 percent ownership of Kraft Heinz.

Kraft Heinz shares closed down 1.7 percent Wednesday.

3G Capital has a strong reputation for successfully finding large cost savings in the companies it acquires. The firm bought Heinz in 2013 and later merged the company with Kraft in 2015.

But the firm's co-founder Jorge Paulo Lemann said its business model of buying strong consumer brands is facing new difficulties from upstarts.

"We bought brands that we thought could last forever," he said at the Milken Institute Global Conference earlier this year, according to Forbes. "You could just focus on being very efficient. ... All of a sudden we are being disrupted."

Kraft Heinz shares have faltered in recent years. Its stock is down more than 30 percent over the past two years versus S&P 500's nearly 30 percent gain.

The company declined to comment.

—CNBC's Lauren Hirsch contributed to this report.