(Reuters) - U.S. home appliances maker Whirlpool WHR.N was able to counter costs arising from trade tariffs by raising prices, helping it beat Wall Street estimates for quarterly profit and driving its shares 7 percent higher on Wednesday.

A car parks by the Whirlpool logo is seen at their plant in Apodaca, Monterrey, Mexico January 27, 2017. REUTERS/Daniel Becerril

The company, which once welcomed President Donald Trump’s tariffs on imported washing machines, has struggled with costs from higher U.S. tariffs on imported steel and aluminum, its two chief raw materials.

The tariffs, the result of a trade dispute between the United States and China, have weighed on Whirlpool’s profits in recent quarters.

In response, the Michigan-based owner of brands including KitchenAid and Maytag has boosted prices of kitchen and laundry appliances.

In the third quarter ended September, Whirlpool sold more of those higher-priced products, thanks to rising consumer spending on durable goods in a strengthening U.S. economy, helping outweigh the impact of tariffs to its costs.

While the effect of higher prices and product mix propelled Whirlpool’s EBIT (earnings before interest and taxes) margin by 2.5 percent, tariffs and raw material costs dragged margins down by 1.75 percent, the company said.

Whirlpool also lifted the lower end of its 2018 adjusted earnings forecast range to $14.50 per share from $14.20. It kept the higher end unchanged at $14.80. Analysts were expecting earnings of $13.95 per share, according to Refinitiv data.

Whirlpool, which does not disclose its U.S. sales, said sales from North America climbed about 5 percent to $2.99 billion during the third quarter.

Net earnings available to Whirlpool fell to $210 million from $276 million a year earlier.

Excluding one-time items, the company earned $4.55 per share, while overall revenue dipped 1.7 percent to $5.33 billion.

Analysts had expected earnings of $3.76 per share and revenue of $5.34 billion, according to Refinitiv data.

Rising concerns about the impact of trade tariffs on profit margins have weighed on the shares of U.S. manufacturers including Caterpillar CAT.N and 3M MMM.N.

Whirlpool’s stock, down 38 percent this year, was last up 5.5 percent at $110 in after-hours trade.