Stocks ended the week in positive territory Friday, extending a recent string of gains despitea much weaker-than-expected jobs report that disappointed investors looking for more evidence the economic recovery is gaining strength.

Since late June, stocks have picked up momentum, ignoring negative economic signals and embracing good ones in hopes that growth would soon pick up.

But the dismal jobs report sent stocks sharply lower Friday, indicating that investors fear the spring’s economic slump was not just a temporary soft patch. The data from the Department of Labor showed that the economy added a paltry 18,000 jobs in June and unemployment ticked up for the third straight month to 9.2 percent.

The poor jobs figures were “hard to ignore for the market and I think market participants were really caught off guard leaning the wrong way,” said Scott Brown, chief economist for financial advisory firm Raymond James in St. Petersburg, Fla.

The Dow Jones Industrial Average ended the day down 0.5 percent, while the Standard & Poor’s 500-stock index, a broader measure of stocks, sank 0.7 percent. The Nasdaq, a more tech-heavy stock index, was down about 0.4 percent. Major equity indexes in Britain, France and India also slid in Friday trading.

Investors instead favored the relative safety of government debt. Yields slid on the 10-year Treasury bond Friday, ending the day at 3.02 percent versus Thursday’s 3.14 percent. Bond prices and yields move in opposite directions, and a lower yield generally means that buyers are willing to earn less on their investment in return for holding government debt. Gold, another defensive play for investors, edged up 0.8 percent to $1,543 per troy ounce.

But the sell-offs weren’t enough to wipe out the markets’ gains for the week. The Dow ended the short holiday week up 0.6 percent, the S&P gained 0.3 percent and the Nasdaq jumped 1.55 percent. The gains marked the second-consecutive week of positive results for the Dow and the S&P, while the Nasdaq is now on a three-week winning streak.

The recent gains reflected investor relief over several positive global developments, said Sam Stovall, chief investment strategist for Standard & Poor’s Equity Research Services. The Greek Parliament approved a new austerity plan, clearing the country to receive more aid. Japan posted strong industrial production that boded well for supply chains here in the United States. And data released Thursday by payroll processing firm ADP showed that private-sector payrolls increased by 157,000 in June, raising market expectations for a more positive unemployment figure Friday.

That all pointed to more stability for investors, according to Stovall.

“A lot of items on investors’ checklists got checked off,” he said. But now, with the dismal unemployment report indicating that the economy is still struggling to create jobs, “it looks like a massive eraser came in and said, ‘No, you still have more things.’ ”

Among the lingering uncertainties is the continuing debate in Washington over raising the country’s $14.3 trillion borrowing limit. If Congress, as expected, increases the debt limit, that would lift even more uncertainty from the markets, analysts said.

“I think some of the uncertainties that corporate America is having right now in terms of hiring will begin to dissipate,” said Peter Cardillo, chief market economist at Avalon Partners, a New York brokerage house. Corporations will probably report strong earnings for the second quarter, and the economy will add 250,000 to 300,000 jobs per month by the end of the year — many multiples of June’s paltry 18,000 figure, he said.

“I think we’re coming out of the soft patch,” Cardillo said.