Stocks rose for a second day after an encouraging report on retail sales suggested that Americans are finally feeling confident enough to spend more.
The market climbed from the start of trading on Thursday, pulled back at mid-morning on fears over a possible Greek default, but managed to hold on to modest gains across industries. Seven of the 10 sectors of the Standard and Poor's 500 rose, led by a 0.7 percent increase in utility stocks.
Investors have worried that corporate profits would stall if the U.S. economy, and the consumers who drive much of its growth, didn't show more vigor. The retail report for May helped ease those concerns, for the moment at least.
“Today's news suggests that the consumer is back on track,” said Clark Yingst, chief stock strategist at Joseph Gunnar & Co.
The S&P 500 climbed 3.66 points, or 0.2 percent, to 2,108.86. The Dow Jones industrial average increased 38.97 points, or 0.2 percent, to 18,039.37. The Nasdaq composite rose 5.82 points, or 0.1 percent, to 5,082.51.
A drop in the price of oil pushed down energy stocks. The top 5 biggest losers in the S&P 500 were all energy companies. Offshore-rig owner Transocean fell 5 percent.
Investors have been watching economic news closely. The economy contracted in the first three months of this year, but recent data, including a report last week of a burst of hiring last month, suggest things are picking up.
The retail report showed that Americans ramped up their spending on autos, building materials and clothing, a sign that strong job growth is starting to boost sales at stores. Retail sales climbed 1.2 percent in May, the Commerce Department said.
James Abate, chief investment officer at Centre Funds, said investors want the economy to strengthen, but not so much as to force interest rates up. Ultra-low rates have helped send stocks higher in the past six years.
Abate said the retail report seemed to strike the right balance.
“Retail sales are showing some strength, but not so much to get the Federal Reserve to act in an aggressive manner to raise rates,” Abate said.
The rise in U.S. stocks followed a climb overseas on hopes that Greece was making progress in its talks with creditors. The rally, which started in Asia and spread to Europe, faded after news that creditors had told Greek Prime Minister Alexis Tsipras to tone down his demands over the next week or face financial ruin. The International Monetary Fund took the toughest stance, saying it was bringing its negotiators back to Washington.
Germany's DAX ended the day up 0.6 percent, half as high as it was earlier in the day. France's CAC 40 added 0.7 percent while Britain's FTSE 100 rose 0.2 percent.
Among other U.S. stocks making moves, Boeing gained $1.34, or 1 percent, to $142.96 after predicting demand for planes will rise as millions of people in developing countries fly for the first time. Boeing forecast a need for 43,560 airplanes worldwide by 2034, double the existing fleet.
Amgen rose $2.41, or 1.5 percent, to $157.96 after a panel of advisers at the Food and Drug Administration recommended approval of a cholesterol-lowering drug for people at especially high risk of clogged arteries.
Citrix Systems jumped 7 percent after the software company received a letter from investment firm Elliott Management proposing a shakeup in strategy. The software company rose $4.42 to $70.39.
In afterhours trading, Twitter jumped $2.66, or 7 percent, to $38.50 after announcing that CEO Dick Costolo will step down after almost five years leading the company.
Benchmark U.S. crude fell 66 cents to close at $60.77 a barrel in New York after the International Energy Agency projected higher global crude production in a monthly report. Brent crude, a benchmark for international oil used by many U.S. refineries, fell 59 cents to close at $65.11 in London.
In other futures trading on the NYMEX:
— Wholesale gasoline fell 0.8 cent to close at $2.138 a gallon.
— Heating oil fell 2.5 cents to close at $1.921 a gallon.
— Natural gas fell 6.6 cents to close at $2.825 per 1,000 cubic feet.
The euro fell slightly to $1.1258 from $1.1348 late Wednesday. The dollar rose to 123.45 yen from 122.70 yen.
In government bond trading, the yield on the 10-year Treasury note fell to 2.38 percent, down sharply from 2.49 percent the day before, its highest level of the year.