(Bloomberg) -- 3M Co.’s profit topped Wall Street estimates in the second quarter, driving a rise in the annual outlook, after sweeping cost cuts fueled better-than-expected earnings and cash flow.

Adjusted earnings were $2.17 per share compared to analyst estimates of $1.73. The St. Paul, Minnesota-based company now expects full-year adjusted profit of $8.60 to $9.10, up from $8.50 to $9 previously.

“As we execute our strategy, we are positioning 3M for long-term performance, including progressing the planned spin of our Health Care business and addressing a significant portion of PFAS litigation,” Chief Executive Officer Mike Roman said in a statement.

Read More: 3M’s Dark Chapter Deepens As CEO Faces Beaten Down Investors

The results underscore how major restructuring actions Roman initiated earlier this year are beginning to take hold as the company contends with uneven demand and uncertainty over large legal liabilities. 3M shares rose as much as 6.3% during normal trading in New York, the most since June 2.

Despite topping its own estimates, 3M lifted its full-year outlook to a lesser degree, suggesting a conservative approach in their revised targets, JPMorgan analyst Steve Tusa said in a note.

“Bottom line, better-than-expected margins are a positive here,” he said. “We see the point in establishing a track record of conservatism and the earnings trajectory is a bit better than expected.” 

Sales declined 2.2% organically, better than the 4.5% drop estimated by analysts. Revenue at 3M’s key Transportation and Electronics division fell 1.3% organically, much less than the 7.6% decline expected by Wall Street.

3M reported a few other bright spots. The company is seeing less pressure from inflation than it did a year ago, supply chains are healing and logistics costs are coming down, Chief Financial Officer Monish Patolawala said during a conference call with analysts. All of those factors put 3M under severe pressure during the economic rebound from the pandemic.

Still, the maker of Post-it notes, industrial adhesives and electronics display materials continued to see weakness in markets that have been soft for the better part of a year. Demand for electronics and consumer retail products remains sluggish while trends were mixed in industrial markets, Patolawala said. China’s economic recovery is also progressing slowly.

The company has “yet to see signs of improvement” in those trends, he said.

3M is a central defendant in a sprawling courtroom brawl over so-called forever chemicals that stands to be one of the largest pollution cases in history. It recently agreed to pay out as much as $12.5 billion for just one tranche of claims it faces over the chemicals, with several more remaining. 3M took a $10.3 billion pre-tax charge on the proposed resolution that was adjusted out of its results, as expected. 

It’s also working resolve more than 200,000 lawsuits alleging faulty earplugs it supplied to US combat troops led to hearing damage. Analysts expect a resolution to cost several billions of dollars on its own.

Those issues have been an overhang on 3M’s shares as investors worry that resolutions will eat into the cash generated by 3M’s operations. During the call, Patolawala expressed confidence that the company will continue to invest in its businesses and return capital to shareholders, while also meeting cash needs tied to litigation. 

3M this year has announced plans to cut roughly 8,500 jobs in response to slumping demand and to reduce layers of management in a bid make the company more nimble and streamlined. The latest initiative, announced in April, is expected to reduce expenses by as much $900 million a year.

--With assistance from Thomas Black.

(Updates with shares, analyst commentary from fourth paragraph and CFO commentary)

©2023 Bloomberg L.P.