By Suzanne Kapner and Andrew Scurria

J.C. Penney Co. dressed middle-class American families for more than a century, but its failure to evolve as shopping habits changed in the past decade set the retailer on a long march toward bankruptcy.

On Friday, Penney filed for chapter 11 bankruptcy protection in Texas, becoming the biggest in a parade of retailers to seek a court restructuring during the coronavirus pandemic. Neiman Marcus Group Inc., J.Crew Group Inc. and Stage Stores Inc. have all filed for bankruptcy this month.

The retail chain said it plans to use the bankruptcy process to close an undisclosed number of its roughly 850 department stores and put itself up for sale.

Store shutdowns since March have choked off Penney's revenue, putting more pressure on the company's lopsided balance sheet. After years of falling sales, red ink and failed turnaround efforts, the coronavirus pandemic hastened a reckoning with creditors.

The company has been in discussions with some of its largest lenders, including Sixth Street Partners and the credit-investing arms of KKR & Co., Apollo Global Management Inc. and Ares Management Corp., as well as H/2 Capital Partners Inc., people familiar with the matter said.

Like other big chains that have struggled with the move to online retail and changing customer tastes, Penney has sought to stay relevant even while losing money. But the coronavirus and government-mandated closures pushed it over the edge, according to Jill Soltau, Penney's chief executive.

"The closure of our stores due to the pandemic necessitated a more fulsome review to include the elimination of outstanding debt," Ms. Soltau said.

Penney's sales, which totaled $10.7 billion in the most recent fiscal year, have fallen each year since 2015, and it hasn't made an annual profit in nearly a decade. The company skipped two interest payments in recent weeks, setting the clock on a bankruptcy filing.

The 118-year-old Penney is the latest American retailer to seek bankruptcy protection as the rise of fast-fashion, off-price chains like T.J. Maxx and e-commerce giants such as Amazon.com Inc. win over younger shoppers. Other chains like Gap Inc. and Nordstrom Inc. have recently raised billions in debt to ensure they have the cash to weather the crisis and reopen stores.

Department stores have been particularly hard hit by the changes. Stage Stores, which operates the Gordmans, Bealls and Goody's chains in mostly rural towns, is liquidating hundreds of stores when they reopen this month and looking for a buyer. Both Macy's Inc. and Nordstrom are closing some flagship stores.

Like its rival, Sears Holdings Corp., Penney for decades was a one-stop shop for millions of middle-class families, offering clothes, appliances, gardening equipment, portrait studios and beauty salons. At one point, it owned a bank and the Eckerd drugstore chain. It was a fixture in American shopping malls and at its peak in the 1970s operated more than 1,600 stores.

Penney listed assets of about $8.6 billion and debts of more than $8 billion in its chapter 11 petition filed in U.S. Bankruptcy Court in Corpus Christi.

Senior lenders have committed to supplying $900 million in financing to keep Penney afloat during the bankruptcy process. The company also said it has roughly $500 million in cash on hand.

Some 70% of Penney's lenders have signed on to support a restructuring proposal that would reduce "several billion dollars in indebtedness," the company said. Any chapter 11 plan would require court approval.

Founded in 1902 by James Cash Penney, the first store, in Kemmerer, Wyo., was called the Golden Rule and sold textiles and sundries. By 1913, with 36 locations, it changed its name to J.C. Penney. It went public in 1929 amid the stock market crash. It survived the Great Depression and after World War II opened hundreds of stores in newly built suburban malls.

Before Sam Walton founded Walmart Inc., his first job in retail was as a salesman at a Penney's in Des Moines, Iowa, in the early 1940s. "I worked for Penney's for about 18 months, and they really were the Cadillac of the industry as far as I was concerned," Mr. Walton recalled in his 1992 autobiography.

Penney published its first catalog in 1963. It became one of the largest catalog publishers in the country after Sears shut its catalog in 1993. Penney discontinued its "Big Book" in 2010 to focus on e-commerce. But it made a push back into catalogs five years later, after realizing that many online sales were inspired by what shoppers saw in print.

Penney sold the Eckerd chain in 2004. Two years later, it formed a partnership with beauty chain Sephora to open shops selling makeup and skin care in Penney stores. Sephora was an important deal for Penney, helping it woo a new set of shoppers. But it would be one of the last successful moves by the chain.

In 2011, with sales flagging, it hired former Apple Inc. executive Ron Johnson, who eliminated discounts in favor of everyday low prices and dropped popular in-house brands. Shoppers bolted. By the end of 2012, sales had fallen to $12.99 billion from $17.26 billion a year earlier.

Former Home Depot Inc. executive Marvin Ellison took the reins in 2015, but left three years later to become CEO of Lowe's Cos. While at Penney, he brought back appliances, a category it had exited in 1983. The appliance rollout took the focus off apparel, Penney's core business, and sales suffered.

Like other department store chains, Penney had been trying to attract younger shoppers. But it gave up on that goal to focus on winning back middle-aged moms.

"They lost their core customer, and they have never been able to get her back," said Chuck Grom, an analyst with Gordon Haskett Research Advisors.

Ms. Soltau, who has been CEO since 2018, refocused on apparel and launched a test store in Texas with a fitness studio and videogame lounge.

The company sold assets, including its Plano, Texas, headquarters, to help reduce debt. By last year, its shares, which had sunk below $1, were at risk of being delisted from the New York Stock Exchange.

In court papers, Penney listed its largest shareholder as BlackRock Inc. with a 13.85% stake.

Shares closed Friday at 24 cents.

Write to Suzanne Kapner at Suzanne.Kapner@wsj.com and Andrew Scurria at Andrew.Scurria@wsj.com