NEW YORK (AP) — J.C. Penney slashed its annual profit forecast as it accelerated the clearance of slow-moving inventory and warned of weaker sales.

Shares tumbled more than 20 percent to an all-time low Friday, pulling Sears, Dillard's, Kohl's and other retailers down with it.

The S&P index that tracks department stores tumbled 4.8 percent.

The warning was taken as a bad omen for retailers, particularly those that rely on clothing sales, as they head shakily into the crucial holiday shopping season.

Like many department stores, J.C. Penney has tried to reinvent itself as American spending patterns change radically. That transformation has meant less spending on clothes, and more spending on the home, or getting out of it for dinner or a trip to the spa. When money is spent on clothing, increasingly it ends up in the register at discount stores like T.J. Maxx, or more menacingly, at Amazon.com.

As the department store sector was pummeled Friday, shares of Amazon surged 13 percent to an all-time high a day after it blew Wall Street expectations out of the water and posted a 34 percent spike in quarterly revenue.

Amazon now employs 540,000 people, a 77 percent jump from just last year while department stores lay off workers and close locations as they try to figure out what people want.

J.C. Penney, for example, is once again selling major appliances and it's expanding its Sephora beauty shops within stores.

"While we acknowledge the positive work (J.C. Penney) is doing to become less apparel reliant, the sector faces intense secular headwinds as mall traffic wanes and the shift to (e-commerce) should also continue to weigh on profitability," wrote Randal J. Konik, an industry analyst at Jefferies.

J.C. Penney, which had told investors to expect per-share profits between 40 and 65 cents for the current fiscal year, now says it expects those profits to be between only 2 and 8 cents.

Revenue at stores opened at least a year will be unchanged or down 1 percent for the year, the department store said Friday, just two months after saying that that revenue could be up as much as 1 percent.

For the third quarter, which ends Saturday, the company expects a per-share loss of 40 to 45 cents. That's much deeper than the 17 cent loss that analysts expected, according to FactSet.

Slashing prices on poor-selling merchandise, primarily women's clothing, helped sales in September and October but that has squeezed profits. It was the right decision, the company said Friday, as it moves into the crucial holiday season.

The Plano, Texas, department store will release third-quarter earnings on Nov. 10.

J.C. Penney, like other retailers, has struggled to follow shoppers who have migrated online.

Shares, already down 65 percent this year, bounced from lows on the day, but in midday trading were still down 10 percent at $3.28 in afternoon trading.