Sales in the United States, the company's biggest market, fell 1.9% to $4.51 billion in the second, but topped the average analyst estimate of $4.43 billion.
This is the company's first better-than-expected U.S. sales performance in at least five quarters.
Kraft Heinz raised prices of its packaged foods and condiments as rising input expenses, including higher transport and commodity costs, weighed on the company's margins.
Net income attributable to the company's shareholders fell to $756 million, or 62 cents per share, in the three months ended June 30, from $1.16 billion, or 94 cents per share, a year earlier.
Excluding items, the company earned $1 per share, beating analysts' estimate of 92 cents, according to Thomson Reuters I/B/E/S.
The company said net sales rose 0.7 percent to $6.69 billion, topping average estimate of $6.59 billion.
Stronger Than Expectations
“Our results through the first half were stronger than the expectations we put forward as recently as three months ago, and we have been even more encouraged by our recent performance in the marketplace,” said Kraft Heinz CEO Bernardo Hees.
“We believe we are now in a position to drive sustainable top-line growth from a strong pipeline of new product, marketing and whitespace initiatives that are backed by investments in capabilities for brand and category advantage."
Hees added that while cost inflation has been holding back the company's bottom line, "we expect our profitability to improve by year-end, with further momentum into 2019.”