Crisis-weary investors scoffed Monday at what had appeared to be a hopeful turn in the European debt crisis: a victory for pro-Europe parties in a Greek election. U.S. stocks were little changed, and borrowing costs for Spain surged to alarming levels.

Investors appeared fed up with policy makers' inability to resolve a crisis that has bedeviled markets for more than three years. Leaders of the most developed countries are meeting in Mexico to discuss the crisis and the slowing global economy.

"Even though we avoided the worst-case scenario in Greece, the crisis has entered a new and dangerous phase, and it doesn't end with Greece," said Michelle Gibley, director of international research at the Schwab Center for Financial Research, a division of the Charles Schwab brokerage.

U.S. indexes opened lower then drifted between modest gains and losses. Homebuilders rallied after a measure of confidence among U.S. builders rose to a five-year high.

Spanish borrowing rates spiked Monday above levels that forced other countries to take bailouts, a sign that bond investors fear Spain will default on its debts.

The Dow Jones industrial average closed down 25.35 points, or 0.2 percent, to 12,741.82. The Nasdaq composite index rose 22.53 points, or 0.8 percent, to 2,895.33. It was lifted by Apple, its biggest component, which rose $11.65, or 2 percent, to $585.78.

Rival tech titan Microsoft will make a "major" announcement after the market closes. Many expect it to introduce a tablet computer that would compete with Apple's market-dominating iPad.

The Standard & Poor's 500 index rose 1.94 points, or 0.1 percent, to 1,344.78. Of its 10 major industry categories, only financials and energy stocks fell. Banks would be hit hard if the European crisis spun out of control. Energy companies followed oil prices lower.

On Sunday, Greek voters elected a party that wants to continue a program of international bailout loans that are conditioned on painful budget cuts. Traders had fretted for weeks that a radical leftist party would prevail and reject Europe's unpopular bailout plan.

The next step, traders feared, would be Greece's dropping the shared currency. Anxiety over a Greek exit was so pronounced that many expected bank runs on Monday if political anti-bailout parties had won the election.

Yet Greece's situation remains precarious. The anti-bailout party got a big chunk of the vote. There's also no guarantee that the winners will be able to form a government. Elections a month ago failed to produce a governing coalition, leading to Sunday's do-over.

Many had expected stocks and other risky investments to rally on relief that the conservative party won. But the broader scope of Europe's financial burdens soon overshadowed whatever breathing room the election provided.

Safe investments rose and riskier ones fell as traders continued their long vigil for a more permanent solution in Europe. Leaders there are considering a centralized system of bank regulation and deposit insurance to complement proposals of closer economic coordination.

"It doesn't appear that any lasting solution is a possibility any time soon," Schwab's Gibley said. "Until we get some kind of coming together, volatility is likely to continue."

Attention shifted Monday toward Spain and Italy, both of which will require international help if they can't convince bond investors that their finances are sound. Benchmark stock indexes closed down 3 percent in Spain and 2.8 percent in Italy.

The yield on the 10-year Treasury note fell to 1.58 percent from 1.63 percent earlier Monday as demand increased for low-risk investments.

The yield on Spanish 10-year bonds jumped as high as 7.18 percent, the highest since Spain joined the euro. Only a week ago, Europe unveiled a massive bailout of Spain's banks intended to reassure investors about the nation's finances.

Greece, Ireland and Portugal needed bailouts after their borrowing costs rose above 7 percent. It looks like tiny Cyprus will need a bailout as well.

The Greek election "should be seen as a significant net positive for markets, but markets don't always react in a rational manner," said David Kelly, chief global strategist for JPMorgan Funds.

Giant military contractor SAIC fell 38 cents, or 3.1 percent, to $11.86. The Defense Department said Friday that SAIC had lost its biggest contract to Lockheed Martin, a $4.6 billion deal to run the department's global network.

Energy prices, which are sensitive to investors' expectations of future economic growth, fell. Benchmark crude for July delivery slid 76 cents to $83.27 per barrel in electronic trading on the New York Mercantile Exchange.