Wall Street nudged stocks to record highs as investors applauded a four-month extension of the tough bailout terms on Greece imposed by its European creditors.
The market moves were modest, but so was the temporary deal: Greek and European financial officials agreed to extend the bailout terms while the two sides try to find a final deal over the staggering 320-billion euro (about $365 billion) debt and a series of economic reforms.
Still, analysts said even a stopgap measure was not a foregone conclusion as the expiration of the original bailout agreement neared late Friday, and failure to find one could have roiled markets.
"Both sides are taking a very hard line, and it certainly seemed like neither one wanted to blink," said Ben Garber, an economist for Moody's Analytics. "The fact that there would be any agreement was not assured."
The Dow Jones industrial average rose 154.67 points, or 0.9%, to 18,140.44, the first record close of the year for the blue-chip stocks.
The Standard & Poor's 500 index rose 12.85, or 0.6%, to 2,110.30, the fifth record close this year for the broad-based index.
The technology-oriented Nasdaq index, which hit its all-time high during the dot-com boom days, is now 93 points away from its March 2000 record after gaining 31.27, or 0.6%, to 4,955.97.
U.S. stocks, though volatile in January, have been trending up since the first of the year, propelled by a spate of recent government reports showing a strengthening domestic economy and a more robust jobs market.
European markets also rose modestly Friday, and the euro, which has plunged more than 17% against the dollar in the last year, was steady at nearly $1.14.
The 19-member Eurozone economy grew at a 0.3% annualized rate in the fourth quarter, better than analysts expected. Growth this year is projected at 1.2%.
But analysts said those economic forecasts — and the relatively high price levels of U.S. stocks — are predicated on Eurozone officials' avoiding the financial turmoil likely to result should Greece abandon the Eurozone.
Greek Prime Minister Alexis Tsipras won election last month on a promise to reverse or alleviate the painful austerity measures imposed on Greece in the bailout from the European Commission, the European Central Bank and the International Monetary Fund.
Greek officials have warned that without a loan extension, the government would run out of money within weeks, leaving it to choose whether to fund basic services or repay creditors.
A default could lead to a run on Greek banks and a shortage of funds to pay a still-bloated government payroll, inciting panic and economic chaos in the struggling country.
The relatively muted market reaction to Friday's 11th-hour compromise stems from the fact that the deal does little to resolve the yawning differences between the two sides, said Bob Johnson, director of economic analysis for the research firm Morningstar Inc.
Greece said European demands would force it to run a budget surplus equivalent to about 4.5% of its gross domestic product, forcing even deeper austerity measures on its beleaguered population. Greece has rejected those terms as unsustainable.
"At the end of the day, they just kicked the can down the road a few more months," Johnson said.
Analysts said that the risks to global markets of a Greek exit, while real enough, are less than they were during previous stages of the crisis in 2010 and 2011 when the country's debt was mostly in private hands and the market was uncertain about which financial institutions were at risk.
As part of the bailout package, the Greek debt is almost entirely on the books of the ECB and other international financial institutions, mitigating the risk of financial contagion.
"We know where every dime of that debt is today," Johnson said.
Analysts said stocks face plenty of other risks, particularly in the U.S., where stocks in the S&P 500 are now trading at relatively high levels.
"Valuations are somewhere between full and stretched," Russ Koesterich, chief investment strategist for investment management giant Blackrock Inc., wrote in a note to investors Friday. He said U.S. investors can expect modest gains and more volatility going forward.
And, analysts said, even modest gains in the U.S. and other developed countries hinge on an orderly resolution of the Greek drama.
"The feeling is there is limited exposure in the real economy to what happens in Greece ... and that there is a stronger firewall compared to the financial market meltdowns of a couple years ago," Moody's Garber said. "But how things behave in a real crisis is difficult to predict."