Trying to fend off unhappy investors and bolster sales of its at-home fitness equipment, Peloton announced Tuesday that it had replaced its chief executive, John Foley, who also is a co-founder, and said it would lay off 2,800 employees.

Barry McCarthy, who stepped down last year as the chief financial officer of Spotify, was named chief executive and Foley was made executive chairman.

The layoffs represent about 20% of its corporate workforce. Separately, the company said it lost $439 million in its most recent quarter, and it lowered its full-year forecasts for revenue, subscriptions and profitability.

Shares of Peloton, which have fallen more than 80% since January of last year, rose more than 25% Tuesday, giving the company a market capitalization of nearly $12.2 billion.

McCarthy takes over Peloton at a tumultuous time. Once a pandemic winner, it has struggled to recalibrate its supply chain to meet tempering demand as consumers have left the house for their workouts.

He will work closely with Foley, a dynamic he is familiar with, having worked alongside founders as a senior executive at Netflix and Spotify.

Peloton said it had been running a succession process over the last several months.

In hopes of shoring up its bottom line, Peloton said it was seeking to save at least $800 million annually by scouring staffing levels, marketing, real estate, software, outside services and more, Jill Woodworth, the company’s chief financial officer, said on the call.

The moves could buy Peloton time as it fends pressure from Blackwells Capital, an activist investor that had called for the company to fire Foley and weigh a sale.

On Tuesday, Blackwells said the company’s actions “do not address any of Peloton investors’ concerns” and cited a long list of potential buyers, including Netflix and Amazon.

A buyer could pay $75 per share and still make money, according to “myriad valuation metrics,” Blackwells said.