By Anora Mahmudova and Sara Sjolin, MarketWatch

U.S. stocks clawed back much of their early losses Monday as investors bet that the decisive outcome of the Greek referendum will force the country's lenders to find a compromise and keep Greece in the eurozone.

The S&P 500 was down 5 points, or 0.2% to 2,071. The Dow Jones Industrial Average dropped 50 points, or 0.3%, to 17,682. The Nasdaq Composite fell 12 points, or 0.2% at 4,997.

The declines tracked losses on the European stock markets (http://www.marketwatch.com/story/european-stocks-knocked-down-as-greek-voters-say-no-to-creditors-demands-2015-07-06), where the Stoxx Europe 600 index fell 1.2% to 378.68 and Germany's DAX 30 index tumbled 1.6% to 10,879. Asian shares also mostly slumped (http://www.marketwatch.com/story/china-shares-rise-after-beijings-weekend-rescue-2015-07-05).

JJ Kinahan, chief strategist at TD Ameritrade, noted that Greece story is far from over.

"I believe people are realizing that it's in everybody's best interest to keep Greece in the eurozone. But the referendum forces financial discipline on someone," Kinahan said.

"We expect volatility to stay higher than usual, however, as there are still lots of uncertainties besides Greece, namely Puerto Rico's debt problems and earnings for the second quarter," he added.

Greece's rejection of austerity: The global selloff came after more than 61% of Greeks voted "no" (http://www.marketwatch.com/story/in-rebuke-to-europe-greeks-vote-resounding-no-to-bailout-terms-2015-07-05) in Sunday's referendum on austerity measures put forward by the International Monetary Fund and the eurozone as terms for further bailout aid. The Alexis Tsipras-led government will now try to renegotiate a new bailout package with the lenders, but economists fear the lenders are unwilling to accept looser reforms, raising concerns that Greece will exit the euro.

"The outcome of the Greek referendum has significantly increased the risk of Greece leaving the eurozone, which is now by far the most likely outcome," said Erik Nielsen, global chief economist at UniCredit, in a note. "The process may start within days or weeks, but it won't be a smooth ride into a new currency. It'll be chaos with political ramifications."

Christine Lagarde, the International Monetary Fund chief, said the agency stands ready to assist Greece. The IMF is one of Greece's three creditors, and the country missed a payment to it at the end of last month.

Follow the latest on the Greek debt crisis here (http://www.marketwatch.com/story/greek-debt-crisis-latest-news-2015-06-29)

The euro was hit hard by the developments (http://www.marketwatch.com/story/euro-falls-against-rivals-as-greek-voters-reject-austerity-demands-2015-07-06) in Greece, changing hands at $1.1032, down from $1.1115 late Friday in New York. The shared currency traded as low as $1.0952 earlier Monday, according to FactSet.

Greece's stock market and the Athex Composite remained closed after being shut last week. The country's banks also stayed closed. The Global X FTSE Greece 20 ETF (GREK) traded, however, and tumbled 9.7%.

Company news: Shares of Aetna Inc. (AET) skidded 7.1% after the health insurer on Friday said it would buy Humana Inc (http://www.marketwatch.com/story/aetna-to-buy-humana-in-37-billion-merger-deal-2015-07-03).(HUM) for $37 billion, after weeks of merger talks. Humana shares rose 0.7%.

For more on today's notable movers read Movers & Shakers column (http://www.marketwatch.com/story/a-schulman-dollar-tree-tesla-shares-in-focus-2015-07-06).

Other markets:Crude oil (http://www.marketwatch.com/story/oil-tumbles-4-after-greek-voters-reject-creditors-reform-proposal-2015-07-06) plunged 5% to $54.02 a barrel ahead of the Tuesday deadline over nuclear deal with Iran. Gold futures (http://www.marketwatch.com/story/gold-little-changed-as-fed-trumps-greek-drama-2015-07-06) were ticked higher to $1.166.20 an ounce.

The dollar traded mostly higher against other major currencies, with the ICE dollar index up 0.1% at 96.22.

Subscribe to WSJ: http://online.wsj.com?mod=djnwires