By Dan Strumpf 

U.S. stocks sank Tuesday, weighed down by the deepening crisis in Greece and by a rout in commodities markets.

The Dow Jones Industrial Average fell 119 points, or 0.7%, to 17565 in midday trading, wiping out a brief opening rally. The S&P 500 lost 12 points, or 0.5%, to 2056. The Nasdaq Composite Index lost 58 points, or 1.2%, to 4934.

The selling was uneven, with materials stocks hit hard by a selloff in commodities from copper to oil. Technology stocks also fell sharply, but sectors seen as havens--including utilities and consumer staples--posted gains.

Investors also fled into the relative safety of government debt. The yield on the 10-year Treasury note sank to 2.205% from 2.280% on Monday as prices rose.

Stock traders said the selling wasn't unusually heavy, and many investors continued to emphasize that U.S. companies were relatively insulated from the turmoil in Greece. The threat of so-called contagion--or cascading losses across asset classes--is more muted than in prior years when a Greek exit from the currency union seemed possible, they said.

"The chance of Greece getting kicked out or pushed out of the eurozone are increasing," said Wasif Latif, who helps manage about $27 billion as head of global multi-assets as USAA Investments. But he added that the selloff in European and U.S. equities don't indicate "a panic mode or a crisis situation."

The eurozone's top decision makers met Tuesday and pushed for new bailout proposals from Greek Prime Minister Alexis Tsipras after his voters overwhelmingly rejected creditors' austerity measures in Sunday's referendum. Officials warned that a solution won't come immediately. A summit of European leaders will follow a meeting of the currency union's finance ministers.

Greece and its creditors are racing against the clock before Greek banks run out of cash, which could further weigh on the country's struggling economy and pave the way for an exit from the euro. The country faces a July 20 deadline to make a EUR3.5 billion bond repayment to the European Central Bank. Greece's banks and stock market remained closed.

"There are continued concerns on how Greece is going to shake out," said Bill Nichols, head of U.S. equities at Cantor Fitzgerald. Adding to the selling pressure, he said, "is a commodity selloff--gold, crude oil, the energy complex, which is a big piece of the overall market."

Deep losses in commodities markets--spurred by the selloff in China's stock market--spilled over into other assets. Crude-oil futures fell 1.1% to $51.92 a barrel, extending Monday's nearly 8% loss. Gold futures lost 1.8% to $1152.30. Copper, soybeans and cotton prices also tumbled.

U.S.-listed shares of Chinese companies posted heavy losses. Shares of Chinese e-commerce giant Alibaba Group Holding Ltd. fell 2.3%. Shares of Baidu Inc., a Chinese Web company, fell 1.7%.

European stocks extended their losses into the afternoon. France's CAC-40 fell 2.3% and Germany's DAX lost 2%.

Many investors say that the ECB's heavy bond-buying program is blunting the impact on financial markets of the tumult in Greece. The central bank is buying EUR60 billion a month in bonds, and some investors say it could step up that program if the upheaval in financial markets intensifies.

"The folks who would be shorting Europe in this environment are not shorting Europe--whether it's the bonds or the equities--because of the QE looming over their heads," Mr. Latif said, referring to the bond-buying program called quantitative easing. Mr. Latif said he remains tilted toward European stocks over U.S. stocks.

Tuesday's declines followed losses on Monday. The Dow lost 0.3% while the S&P shed 0.4%.

"Right now, there's hope that we can get back to the negotiating table and get something done," said Art Hogan, chief market strategist at Wunderlich Securities.

Utilities stocks in the U.S. jumped. The high-dividend sector is often sought out by investors when bond yields fall. Utilities shares in the S&P 500 advanced 1.4%. The dollar rose against the euro and the pound sterling.

In the coming weeks, investors will turn their focus to second-quarter earnings reports from U.S. companies. The earnings season unofficially kicks off Wednesday afternoon with Alcoa Inc.'s second-quarter report. Quarterly profits for S&P 500 companies are forecast to decline 4.5% for the quarter, according to FactSet. That would mark the first decline since the third quarter of 2012. Analysts similarly predicted a decline ahead of first-quarter earnings, but profits ended up rising by 0.8%.

Chinese stocks fell Tuesday, raising concerns about the government's ability to stem the slide. The Shanghai Composite declined 1.3%.

In corporate news, Allergan PLC said it reached a deal to buy the exclusive rights to two experimental migraine drugs from Merck & Co. for $250 million. Allergan shares fell 0.2% while Merck shares gained 0.1%.

Write to Dan Strumpf at daniel.strumpf@wsj.com