U.S. stocks rebounded Friday, but major stock indexes ended the week lower as a federal government shutdown continued for a fourth day, with no sign of an end to a budget stalemate in Washington.

The Nasdaq composite index ended the week higher as Friday’s advance accelerated in the afternoon, but gains by the Dow Jones industrial average and the Standard & Poor’s 500-stock index were not enough to cancel the week’s losses.

The government shutdown has made investors nervous as it drags on, but the impact from it has been relatively limited.

A more serious concern, investors say, is if the shutdown continues and the budget battle becomes tied up with the federal debt limit, which a divided Congress must raise by Oct. 17 to avoid an unprecedented U.S. debt default.

“I think the market will be in a much nastier mood next week if we still don’t have a deal,” said Joseph Quinlan, chief market strategist at U.S. Trust Private Wealth Management.

Reflecting a rise in investor anxiety, some options investors were starting to pay more for protection against market turmoil.

The CBOE Volatility Index (VIX), a 30-day forecast of stock market volatility measured using a strip of near-term S&P 500 options, rose to 16.73 on Friday from 13.12 on Sept. 20, a sign of increased worry, although this level is still considered low.

Heavy buying activity Thursday was seen in October and November VIX out-of-the money call options — contracts that are far from the current level — with heavy open interest additions in November contracts.

“This suggests traders are feeling the need to be protected through mid-November and implies that the market expects negotiations in Washington over the government shutdown and debt ceiling will be long and drawn out,” said Matt Franz, investment adviser representative at Stutland Volatility Group.

The Dow was up 76.10 points, or 0.51 percent, at 15,072.58. The S&P 500 rose 11.84 points, or 0.71 percent, at 1690.50. Nasdaq was up 33.41 points, or 0.89 percent, at 3807.75.

For the week, the Dow fell 1.2 percent, the S&P 500 lost 0.1 percent, and the Nasdaq added 0.7 percent. The S&P 500 has fallen for nine of the past 12 sessions.

The S&P’s biggest loser Friday was struggling retailer J.C. Penney, which fell to its lowest level in more than 30 years, ending down 6.5 percent at $7.86.

Potbelly Corp. said late Thursday that its initial public offering of 7.5 million shares had priced at $14 each. In its first day of trading, the stock more than doubled to $31.84, with more than 14 million shares changing hands. The stock closed up 119.8 percent at $30.77.

Government economic reports have been delayed by the shutdown, and the September payrolls report from the Labor Department was not released Friday as scheduled.

— Reuters