By Anora Mahmudova and Sara Sjolin, MarketWatch

U.S. stocks ended Monday's choppy session slightly lower as global equities came under pressure after Greece on Sunday rejected its international lenders' bailout terms and moved closer to a potential exit from the eurozone.

The main indexes fell sharply at the open, but trimmed losses during the day to end modestly lower.

The S&P 500 closed down 7.98 points, or 0.4% to 2,068.79, with nine of its 10 main sectors finishing lower. Energy sector stocks sold off after an 8% plunge in oil prices.

The Dow Jones Industrial Average 46.13 points, or 0.3%, to 17,683.98, with 24 of its 30 components closing lower. The Nasdaq Composite ended the day down 17.27 points, or 0.3%, at 4,991.97.

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.5% to 10,890. Asian shares also mostly slumped (http://www.marketwatch.com/story/china-shares-rise-after-beijings-weekend-rescue-2015-07-05).

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

JJ Kinahan, chief strategist at TD Ameritrade, noted that the 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.

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.1055, 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 7.5%.

Company news: Shares of Aetna Inc. (AET) skidded 6.4% 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%.

Oil companies were among hardest hit. National Oilwell Vacro Inc (NOV) fell 5%, Transocean Ltd (RIG) fell 4.3%.

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 7.7% to settle at $52.53 a barrel, its lowest level in nearly three months. Gold futures (http://www.marketwatch.com/story/gold-little-changed-as-fed-trumps-greek-drama-2015-07-06) marked first gain in four session, up 0.8% to $1.173.20 an ounce.

Treasuries rallied (http://www.marketwatch.com/story/treasurys-rally-after-greeks-reject-bailout-proposal-2015-07-06), sending the yield on the 10-year note down 11 basis points to 2.28%, the lowest levels since June 19.

The dollar traded slightly 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