NEW YORK — Investors rejoiced over Europe last week. On Monday, they got back to worrying about the United States.

Stocks struggled to stay out of the red in quiet holiday-week trading after the government said American manufacturing shrank in June for the first time in almost three years.

The Dow Jones industrial average opened higher but fell after the manufacturing report came out at 8 a.m. MDT and never recovered. It finished down 8.70 points at 12,871.39.

The Standard & Poor's 500 and the Nasdaq composite index both finished slightly higher after hopping between small gains and losses. The S&P rose 3.35 to 1,365.51. The Nasdaq rose 16.18 to 2,951.23.

Chemical company DuPont fell the most in the Dow. It lost $1.14, or 2.3 percent, to $49.43. Caterpillar, General Electric, Alcoa, Exxon Mobil, Boeing and other companies tied to manufacturing also were down.

It was a tepid performance compared with Europe's. Stock indexes in France, Britain and Germany rose more than 1 percent, still riding the euphoria from Friday's announcement that European leaders will make it easier for banks to get bailout loans. That news pushed the Dow up 227 points Friday.

The government did report a sliver of good news about the U.S. economy Monday, though investors seemed underwhelmed: Construction spending rose in May by 0.9 percent, the most in five months.

Monday was the first day of trading for the second half of the year. In the first half, the S&P gained more than 8 percent. Several financial analysts said they expected volatile markets, at least through the November presidential election.

"We don't know who it will be," said Benjamin Segal, portfolio manager for global equities at Neuberger Berman. "And even if we did, we don't know the particular policies they'd pursue."

Analysts also cited tax increases and spending cuts scheduled to take effect in January — the so-called fiscal cliff.

Derrick Irwin, portfolio manager for Wells Fargo Advantage Funds, said the U.S. market would "muddle through the foreseeable future." Leo Grohowski, chief investment officer of Bank of New York Mellon's wealth-management division, said the market would "continue to move from hope to despair."

Investors hope for some clarity later this week. U.S. car companies report monthly sales Tuesday, retailers such as Target and Macy's report monthly sales Thursday, and a closely watched report on U.S. jobs comes out Friday.

And though stocks rose in Europe, some analysts wondered how long those gains would last. Previous steps to ease the debt crisis have been met by market gains that quickly disappeared.

The day also brought reminders of how badly Europe needs help: Unemployment in the 17 countries that use the euro hit the highest level since the euro was launched in 1999.

In France, auditors warned that the country still has a big budget hole to plug. In Cyprus, leaders prepared for talks on its own bailout. And in Germany, the highest court announced it would hear arguments from people who want to block the rescue.