By Alexander Gladstone

Gym chain 24 Hour Fitness Worldwide Inc. filed for bankruptcy protection Monday as it deals with the fallout from temporarily closing its locations due to the Covid-19 pandemic.

The San Ramon, Calif., company, which is owned by private-equity firm AEA Investors LP and the Ontario Teachers' Pension Plan, aims to permanently shut down 135 of its 445 gyms throughout the U.S. The gym chain, which has about 3.4 million members, plans to reopen most remaining locations by the end of June.

The company sought protection under chapter 11 in the U.S. Bankruptcy Court in Wilmington, Del., seeking to restructure some $1.4 billion in debt, including $930 million of senior loans and a $500 million unsecured bond. The gym chain said that it has reached an agreement with a group of creditors to provide about $250 million of debtor-in-possession financing to fund its business during the bankruptcy case.

The Wall Street Journal reported in May that 24 Hour was shopping for a bankruptcy loan of as much as $200 million.

"If it were not for Covid-19 and its devastating effects, we would not be filing for chapter 11," Chief Executive Tony Ueber said. "We expect to have substantial financing with a path to restructuring our balance sheet and operations to ensure a resilient future."

Even before the pandemic, 24 Hour Fitness was struggling with declining membership and rising costs due to minimum-wage increases. The company had earlier tried to save costs by eliminating towel services at the majority of its clubs.

The company's restructuring chief, Daniel Hugo, said Monday that a number of operational missteps in previous years had hurt its financial performance.

The company was beginning to see positive changes under a new management team installed in early 2019, but its turnaround efforts were materially disrupted by Covid-19, Mr. Hugo said in a declaration filed with the court.

Last year, 24 Hour Fitness brought in $1.5 billion of revenue. Before furloughs and layoffs due to Covid-19, the company had approximately 19,200 employees. After temporarily closing its clubs in mid-March, 24 Hour furloughed 17,800 employees and terminated 700 others, the company said.

The chain is now reopening gyms it plans to keep. It has reopened about 20 of its fitness centers in Texas. The company is using an app-based reservation system to enforce social-distancing requirements and a touchless check-in system to limit contact with surfaces, Mr. Hugo said.

The coronavirus outbreak has hurt a number of other fitness chains. Gold's Gym International Inc. filed for bankruptcy in May. Town Sports International Holdings Inc., the parent company of New York Sports Clubs and Lucille Roberts gyms, has hired lawyers to explore a debt restructuring, which could include a bankruptcy filing.

Businessman Mark Mastrov founded 24 Hour Fitness in 1983. AEA, Ontario Teachers' Pension and other investors paid $1.85 billion for the chain when they bought it in 2014 from private-equity sponsor Forstmann Little & Co.

Judge Karen B. Owens of the U.S. Bankruptcy Court in Wilmington has been assigned to oversee the 24 Hour bankruptcy case, number 20-11558.

--Dave Sebastian contributed to this article.

Write to Alexander Gladstone at alexander.gladstone@wsj.com