Peloton appeared dug in. The home exercise company had been adamant for weeks that it was not going to agree to a voluntary recall of its Tread+ treadmill, despite the $4,300 machine being tied to dozens of accidents where children and adults were pulled under by the rotating track, resulting in one child’s death and many injuries.

The company refused to provide federal safety regulators with the identity of the 6-year-old child who died in March, citing privacy concerns. An investigation by the Consumer Product Safety Commission was delayed as the agency took the unusual step of issuing an administrative subpoena to get the information, according to officials familiar with the incident who requested anonymity to discuss internal deliberations.

After Peloton rejected the CPSC’s request for a recall, the agency instead ran a public warning notice in April telling consumers to stop using the treadmills. Peloton responded with a statement calling the agency’s claims “inaccurate and misleading.” Peloton chief executive John Foley said they had “no intention” of taking the treadmills off the market.

But Peloton’s tough stance quickly buckled.

It faced a backlash from appalled consumers. Its stock price slumped. A private meeting with a U.S. senator showed there was little support for the company’s position, according to two officials familiar with the matter. And Peloton hired a new attorney to handle its negotiations with the CPSC, opting for a less hard-nosed approach.

In a stunning reversal, the company struck a deal Wednesday with the CPSC for a voluntary recall of its 125,000 Tread+ treadmills. Peloton offered consumers full refunds or the option of keeping the treadmill with improved safety software. Foley put out a statement admitting the company “made a mistake in our initial response” with regulators.

“You don’t very often see a company fight a federal agency like this,” said Kaitlin Wowak, an assistant professor of operations at Notre Dame University, who studies product recalls.

And there is a reason for that, Wowak said. “It’s not a good move.”

Peloton -- celebrated for its stationary bikes and online workouts -- appeared to discover its mistake in the days that followed.

While most product recalls required a company’s cooperation, the CPSC can sue to force a product off the market. That rarely happens.

But CPSC staff recently started work on a lawsuit against Peloton, showing they intended to continue pursing action to get the treadmills off the market, according to the officials.

While Peloton had put off a recall, it was still facing questions about the product’s safety. The CPSC’s warning notice included home security camera footage of a young child being sucked under the treadmill. The child was not injured, but the images dramatically illustrated the potential danger.

Representatives of Peloton then visited staff members in the office of Sen. Richard Blumenthal (D-Conn.), who chairs the senate subcommittee with oversight of the CPSC, in a meeting described as an attempt to gauge the political support for the agency’s actions, according to two officials familiar with the matter.

Peloton did not respond to a request for comment on this topic.

Blumenthal’s office declined to comment, but pointed to a statement issued after the recall was announced.

“This recall is the right step -- though dangerously delayed,” Blumenthal said in the statement.

Peloton also hired a new attorney to deal with the CPSC, switching to someone who used to work for the agency and is known for a friendly approach to regulators, according to two sources familiar with the matter. The new attorney, Neal Cohen, referred questions to Peloton, which did not respond to a request for comment on this topic.

Peloton’s stock price drifted downward after its fight with the CPSC was revealed last month, falling about 7 percent. The stock fell another 14 percent on Wednesday after the recall was announced.

Peloton’s other treadmill, a smaller version called the Tread, was also recalled Wednesday. The treadmill’s large touchscreen monitor can detach and fall off, according to the recall notice. No injuries were reported. This newer treadmill model was still in limited release in the United States, where there are only 1,050, plus another 5,400 in Canada.

A company is taking a risk when it objects to a regulator’s request for a voluntary recall, said Wes Ball, an attorney in Houston who specializes in product defect lawsuits against companies.

Forcing the issue to court means regulators need to identify the product defect that caused the accidents, Ball said.

“That’s the absolute last thing any product manufacturer wants” because it opens up a company to personal injury lawsuits and liability, he said.

A voluntary recall, in contrast, usually allows a company to avoid spelling out the danger.

The CPSC’s recall notice of Peloton’s Tread+ does not explain why the accidents occurred.

Peloton received 72 reports of adults, children, pets and objects being pulled under the back of the treadmill. This included 29 reports of injuries to children that included broken bones, cuts and third-degree abrasions.

The Tread+ has an unusual slatted running surface with spaces between the slats that open and close as the surface rotates over the end of the machine, like a tank tread.

Peloton introduced the Tread+ three years ago. The company’s patent for a slatted-track treadmill was finally approved by the U.S. Patent and Trademark Office on April 13. Four days later, the CPSC issued its warning against using it.