Stocks closed mixed for a second day after investors grew pessimistic about the market’s ability to keep its rally going.

The Dow Jones industrial average rose 9 points Friday. It had been up as much as 68 after European leaders announced a plan to help Greece with its debts. A similar advance and retreat occurred Thursday.

There wasn’t a clear reason for stocks’ retrenchment Friday. But analysts said the market does need a break from a climb that has now gone on for two months with few interruptions. The Dow has advanced 17 of the last 21 days.

“The market is extremely vulnerable to a pullback,” said Christian Bendixen, director of technical research at Bay Crest Partners in New York.

Even with the mixed finish Friday, major stock indexes still managed to rise for a fourth straight week.

The early gain in stocks came after the European Union and International Monetary Fund created a bailout program that will help Greece and other European nations facing rising debt. The deal reached late Thursday will not make money immediately available to Greece, but instead act more as a safety net.

“It reinforces there will be a rescue and support for Greece,” said Oliver Pursche, executive vice president at Gary Goldberg Financial Services. “It lays the groundwork for future rescue packages.”

Investors have worried that mounting debt problems in places like Greece, Portugal and Spain would spread to other countries and hamper a global economic rebound.

The reassurance that Greece will get aid, if necessary, helped the euro rise against the dollar. The euro hit 10-month lows during the week.

But the gains faded as traders became uneasy after the extended string of advances, which have come on light volume. When trading volume is weak, investors often worry that only a small number of buyers are driving the market higher.

“Investors may be trigger-happy to lock in gains at any sign of selling,” said Michael Sheldon, chief market strategist at RDM Financial Group.

The yield on the benchmark 10-year Treasury note fell to 3.85 percent from 3.89 percent late Thursday. The 10-year note is often used as a benchmark for interest rates on consumer loans.

The coming week is a short one for investors. Markets will be closed for Good Friday. But there will be plenty of economic data to digest, including consumer confidence figures on Tuesday and a manufacturing report on Thursday. The government will release its March employment report on Friday, but investors will have to wait to Monday to trade on the news.

Investors brushed aside Friday’s final update to the gross domestic product report that showed the U.S. economy grew at a 5.6 percent pace in the fourth quarter, just below the 5.9 percent forecast by economists polled by Thomson Reuters.

Much of the growth was tied to a surge in spending from government stimulus measures and manufacturing as businesses restocked exceptionally low inventories. Those gains are seen as temporary, so GDP likely has slowed sharply in the first quarter.

Consumer spending also remains weak and has not been able to replace the slack from a slowdown in government measures. Consumers are cautious because unemployment remains high, analysts say.

The Reuters/University of Michigan consumer sentiment index for March was revised to 73.6 from a previous estimate of 72.5. The revised number was better than the 73 reading economists had forecast, but only even with February’s figure.

Daniel Egan, president of the Massachusetts Credit Union League, said the sentiment reading is likely to remain in its current range until there are signs of jobs growth.

Consumers are “frozen” right now because they are still unsure about their jobs, Egan said. The updated GDP report showed consumer spending was even slower at the end of 2009 than previously estimated.

High unemployment has made consumers cautious, which has been reflected in mixed consumer confidence surveys in recent months. The Labor Department’s employment report next Friday is expected to show that employers added jobs in March for only the second month since the recession began in December 2007.

Economists predict employers added 168,000 jobs in March after shedding 36,000 in February.

Advancing stocks narrowly outpaced those that rose on the New York Stock Exchange, where consolidated volume came to 4.7 billion shares, compared with 5.7 billion Thursday.

The Russell 2000 index of smaller companies fell 0.13, or less than 0.1 percent, to 678.97.