NEW YORK - U.S. stocks swung from losses to modest gains Tuesday as European leaders met to discuss Greece's strained finances. The biggest winners were utilities, large stable stocks that usually hold up well in a downturn.
The Standard & Poor's 500 index finished the day up 13 points, or 0.6 percent, at 2,081. The Dow Jones industrial average rose 93 points, or 0.5 percent, to 17,777, while the Nasdaq composite gained six points, or 0.1 percent, to 4,997.
Greece and its creditors were holding talks in Brussels on Tuesday to discuss how to keep the country from falling out of the euro. Analysts say Greece has little time left before its banks run out of cash. The European Central Bank has refused to increase the emergency credit the banks need to cope with withdrawals.
"It's all Greece all the time," said Burt White, chief investment officer at LPL Financial. White thinks that once quarterly earnings reports start to roll in over the coming weeks, investors will turn their focus to the U.S. and its improving economy. That shift could help pull the stock market out of its rut.
Horizon Pharma offered roughly $2 billion to buy Depomed, a rival pharmaceutical company, in a hostile bid. The Dublin-based company took the offer directly to shareholders after Depomed's executives reportedly refused to talk about a previous proposal. Horizon fell 55 cents, or 2 percent, to $33.95, while Depomed soared $7.50, or 36 percent, to $28.14.
Major indexes in Europe finished broadly lower. Germany's DAX slid 2 percent and France's CAC-40 lost 2.3 percent. Britain's FTSE 100 dropped 1.6 percent.
Markets in China extended a recent slump. The Shanghai Composite Index fell 1.3 percent, while Hong Kong's Hang Seng lost 1 percent. Tokyo's Nikkei 225 advanced 1.3 percent, and Seoul's Kospi lost 0.7 percent.
China's stock market has lost nearly 30 percent after hitting a peak in June. The government has responded with a slew of new emergency measures, but analysts argue that they can't keep prices up without some improvement in economic growth.
"China's leadership has doubled down on its efforts to prop up equity prices," said Mark Williams of Capital Economics in a report. "There is a good chance that the market rescue efforts are seen to be a failure in a few months' time."
Precious and industrial metals futures closed lower. Gold lost $20.60 to settle at $1,152.60 an ounce, silver slid eight cents to $14.95 an ounce. Copper lost 9 cents to $2.45 a pound.
Benchmark U.S. crude fell 20 cents to $52.33 a barrel on the New York Mercantile Exchange. On Monday, the contract plummeted 8 percent amid concerns that the crisis in Greece would trigger a slowdown in Europe.
U.S. government bond prices rose, pushing the yield on the 10-year Treasury note down to 2.24 percent from 2.29 percent late Monday. The dollar fell to 122.47 yen from 122.64 yen, while the euro declined to $1.0983 from $1.1056.