MIDLAND, Mich. (AP) — Dow Chemical Co. on Thursday posted a loss driven by charges related to the buyout of rival Rohm & Haas and dismal sales for chemicals used in everything from plastic bags to cars.

Yet aggressive cost cutting by the Midland, Mich.-based company led to a surprise profit if one-time charges are stripped from the results, and Dow said conditions improved in some areas over the past three months.

Dow said it lost $486 million, or 47 cents per share, compared with earnings of $762 million, or 81 cents per share during the same period last year.

Dow completed a $16.5 billion buyout of Rohm & Haas, a specialty chemicals manufacturer. Dow has hastened to cut debt levels after closing the deal in April. The company has shed assets, cut about 10,000 jobs and closed 20 factories.

Second-quarter results include charges related to adjusting values for Rohm and Haas inventories, restructuring, other acquisition costs and discontinued operations. Excluding one-time items, Dow reported adjusted earnings of 5 cents per share.

Still, sales came in well below Wall Street expectations and company shares slid 37 cents to $19.90 in premarket trading.

Revenue fell 31 percent to $11.32 billion, down from $16.35 billion in the prior-year period.

Analysts polled by Thomson Reuters forecast, on average, a net loss of 8 cents per share on revenue of $13 billion. Analysts typically exclude one-time items.

Dow said conditions improved from the first quarter, citing volume gains, cost cuts and stabilizing prices.

Additionally, on Thursday Dow added to its list of divested assets by announcing plans to sell its Malaysian-based Optimal business to Petronas for $660 million. The deal is expected to close at the end of the third quarter.