NEW YORK – A burst of enthusiasm over a rescue of Spanish banks melted away within hours Monday, and investor anxiety about the troubled finances of Europe grew on both sides of the Atlantic.

On Wall Street, stocks opened sharply higher but sank all day. Selling accelerated in the last hour of trading, and the Dow Jones industrial average closed down 142 points.

More alarming, bond investors signaled that they are less confident about lending money to the governments of both Spain and Italy, which investors fear will be next to seek help.

Jim Herrick, director of equity trading at Baird & Co., said investors realized “that this Band-Aid approach with Spain will not solve larger problems in Europe and that this could be a long, arduous process.”

As investors considered the long-term fate of Europe, Herrick said, “it was time to sell.”

European countries committed over the weekend to funnel up to $125 billion to Spain to distribute to its banks, which have been driven almost to insolvency from a bust in real estate prices four years ago.

Spain became the fourth European nation to seek a rescue, after Greece, Portugal and Ireland.

Market strategists had hoped that the rescue in Spain would at least temporarily ease fear that debt problems in Europe will explode into a world financial crisis and hurt the fragile global economy.

Those strategists had predicted a rally in stocks after the deal was announced. But the relief was short-lived, and investors were still worried about an election Sunday in Greece that could lead to that country’s exit from the euro.

In the case of Spain, investors appeared uncertain about whether the rescue would be enough to save the banks and whether the terms of the loan, still undisclosed, would deliver another blow to the recession-hobbled Spanish economy.

France’s main stock index closed down 0.3 percent, and Germany’s rose just 0.2 percent. Both indexes were up more than 2 percent earlier in the day. Spain’s benchmark stock index shot higher by 6 percent but closed down 0.5 percent.

In the United States, the broader market drifted lower all day. The Standard & Poor’s 500 index ended down 16.73 points at 1,308.93, and the Nasdaq composite index closed down 48.69 points at 2,809.73.

The Dow finished down 142.97, one of its biggest daily declines this year, at 12,411.23. It opened up almost 100 points.

“People want to see clarity,” said Stephen Carl, head of equity trading at The Williams Capital Group, an investment bank in New York. “No one likes a situation that’s to be determined.”

Finance ministers of the 17 countries that use the euro currency said they would make the $120 billion available to the Spanish government to distribute to its banks. But bond investors were worried that the debt from the rescue package would put additional strain on Spain’s finances. The European Union made clear Monday that there would be some strings attached.

Adding to the economic fear, Italy said its economy contracted by 0.8 percent in the first three months of the year, the worst showing in three years.