As the House debated Republican legislation to raise the debt ceiling, stocks closed mostly lower Thursday, extending several days of losses and sending investors toward safer investments.

The Dow Jones industrial average, a basket of 30 blue-chip stocks, fell 0.5 percent, marking its fifth straight day of losses. The Standard & Poor’s 500-stock index, a broader measure of market performance, retreated 0.3 percent, marking its fourth consecutive decline. The Nasdaq composite index, a more tech-heavy index, ended the day up a tiny fraction, after three days of declines.

But the declines were tempered by a Labor Department report showing that fewer Americans filed for unemployment benefits last week — 398,000 compared with the previous week’s 422,000, well below analyst expectations. The positive reading kept stocks in positive territory for much of the day, raising hopes among analysts that the markets were still paying attention to things other than the ongoing debt impasse.

“You have a market that recognizes that fundamentals are actually looking quite strong,” said Doug Cote, chief market strategist at ING Investment Management in New York. “And if you step back and look at it, the markets have been pretty mild in their volatility.”

Markets are keeping relatively calm despite the looming possibility of a first-ever default by the U.S. government because they don’t believe it will actually happen, Cote said. “Why hedge against something that’s not going to happen?” he said.

Another measure giving Cote confidence is the TED spread, a measure of the difference on inter-bank loans and short-term U.S. government debt, which remains at a thin 0.18 percent despite the ongoing debt debacle in Congress. That means “the bond market is not pricing in a crisis about to happen,” Cote said.

Indeed, despite the threat of a default and credit-rating downgrade, investors continued to buy up U.S. government debt Thursday, bidding up prices on 10-year Treasury bonds and driving yields down to 2.95 percent from Wednesday’s 2.98 percent. Bond yields and prices move in opposite directions, and a higher yield generally means investors are willing to accept a lower return in exchange for the safety of owning government debt.

The move to safer investments also was apparent in the currency market, where the dollar declined against the yen and Swiss franc. The two currencies are the “favorite” safe havens in the currency world, said Win Thin, a currency strategist at Brown Brothers Harriman, because they tend to be less affected by market swings than other major denominations.

In early trading Thursday, Japan’s Nikkei 225 Stock Average slid 0.1 percent and the yen climbed as much as 0.2 percent against the dollar, the strongest level since March 17, Bloomberg News reported.

Gold, also viewed as a safe store of value during turbulent times, traded at $1,613.40 per ounce Thursday afternoon, little changed.

“I think what we’ve been seeing in the past several weeks, several months is that kind of trend toward a safe haven,” said Jeff Clark, a precious-metals analyst at Casey Research in Sacramento.