A massive litigation settlement, declining sales and thinner profit margins prompted a rare loss in 3M's second quarter.

But investors still liked what they saw Tuesday, sending the company's battered stock price up more than 5%.

"We made significant progress on the important actions we have been taking to improve performance and shape the future of 3M," CEO Mike Roman told investors on a conference call Tuesday. Those actions include sweeping layoffs, the "forever chemicals" settlement and preparing for a health care spinoff.

The maker of Scotchgard and N95 respirator masks increased earnings guidance by 10 cents per share for the year as a result.

For the second quarter, the Maplewood-based company reported a loss of $6.8 billion, or $12.35 a share. Adjusted earnings per share of $2.17 lagged last year but beat analyst estimates.

The company recorded an expected $10.3 billion charge during the quarter to cover a recently announced PFAS settlement with public water providers.

As the company continues to contend with litigation on multiple fronts and declining sales across its business groups, it is "aggressively reducing management layers and rooftops," Chief Financial Officer Monish Patolawala said.

The company has announced 8,500 job cuts this year, about 10% of its global workforce. 3M is also selling its Wonewok resort in northern Minnesota and ceasing aviation operations.

"As we exit 2023, we will be a stronger, leaner and more focused 3M," Patolawala said.

A year after announcing 3M would spin off its $8.6 billion health care business, Roman revealed Tuesday the company is in "the final steps of naming a CEO" for that company.

3M is now saying the spinoff could take until early 2024 to complete after initially aiming for the end of this year. The new company will remain in Maplewood in the short-term while it searches for a permanent headquarters.

After an analyst asked Tuesday whether the company's stock price is a factor in how 3M approaches battling or settling ongoing PFAS, earplug and medical device litigation, Roman said "the strategy is independent of what the share price is doing."

"We are focused on doing what we can to address litigation and uncertainty," he said. "We do not like the overhang on the stock, and we want to manage it, but we have got to do what is in the best interest of the company for the long-term."

Sales fell 4% from the year-ago period to reach $8.3 billion. The company forecasts full-year sales to decline as much as 5% compared to 2022.

Expected earnings per share of $8.60 to $9.10 will be the lowest annual haul for 3M since 2019.

3M's share price rose 5.3% on Tuesday to end the day at $109.83, the best closing price since March. The stock has traded as high as $152.30 and as low as $92.38 through the past year.