(Reuters) - Kraft Heinz Co KHC.O topped quarterly profit and revenue estimates on Friday as the Tater Tots maker raised product prices and posted higher-than-expected sales from the United States for the first time in several quarters.

A box of Kraft Velveeta shells and cheese is displayed in a grocery store in New York March 25, 2015. REUTERS/Eduardo Munoz

Shares in the Chicago-based company rose as much as 9.4 percent, the stock’s biggest percentage gain in 18 months.

Many packaged food companies have been forced to nudge prices up in recent months to combat skyrocketing commodities and transportation costs. Prices had long been suppressed by fierce competition between retailers and changing consumer eating habits.

Kraft Heinz, which also makes Philadelphia cream cheese and Planters peanuts, said it had raised prices everywhere but Europe, the Middle East and Africa.

The company still expects second-half organic sales to be higher than in the first half of the year, but warned that earnings would now be evenly split across both halves due to spending on commercial investments and persistently higher input costs.

“Mainly at freight and transportation, packaging, both resins and cardboard as well as tariff risk currently impacting foil and aluminum costs in the U.S. and certain products we sell in Canada,” Chief Financial Officer David Knopf told analysts on a call. The company does still expect constant currency adjusted core earnings to improve by year-end and gain momentum into 2019, he added.

Last month, Canada struck back at the Trump administration over U.S. steel and aluminum tariffs, imposing taxes on C$16.6 billion of U.S.-made products. Retaliatory measures covered soup, ketchup, mayonnaise, strawberry jams and several other products that Kraft Heinz makes.

“There are so many uncertainties here ... they’re trying to manage expectations in case costs stay higher for longer or things with tariffs get worse,” Edward Jones analyst Brittany Weissman said.

INVESTMENTS PAYING OFF

Kraft Heinz, controlled by Brazil's 3G Capital and Warren Buffett's Berkshire Hathaway Inc BRKa.N, has been trying to prove that it can grow through product innovation and investments in e-commerce and food startups.

Weissman said Friday’s results signaled Kraft Heinz’s investments might finally be showing results, despite market skepticism.

Sales from the United States, the company’s biggest market, topped the average analyst estimate of $4.43 billion - the company’s first U.S. sales beat in at least five quarters.

Analysts have also been waiting for Kraft Heinz to announce a new acquisition since its failed bid for Unilever ULVR.L last year. 3G is known for engineering big mergers, such as the creation of Restaurant Brands International Inc QSR.TO by combining Burger King with Canada's Tim Hortons.

Bernardo Hees, Kraft Heinz’s Chief Executive and a partner at 3G, said Kraft Heinz was waiting for a deal that would make the company stronger for years to come, not one it would regret in a couple of years.

Since Campbell Soup Co CPB.N said in May it would embark on a strategic review, reports have surfaced speculating on Kraft Heinz's interest in the company.

Kraft Heinz is also selling a portfolio of Indian brands and has narrowed down a list of bidders, Bloomberg reported on Friday.