Stocks end higher for second day; S&P 500 near record

U.S. stocks rose modestly on Thursday, extending the prior day's rally, as investors weighed varied economic reports a day after the Federal Reserve signaled interest rates would remain low for the foreseeable future.

Hewlett-Packard fell after provider of computer hardware and services tallied second-quarter earnings per share of 88 cents, excluding items, on $27.3 billion in revenue, versus estimates of EPS of 88 cents on $27.4 billion in sales.

Chinese retailer rose in its first day of trading on the Nasdaq; Best Buy gained after the electronics retailer reported first-quarter earnings that beat estimates; Dollar Tree rallied after the discount retailer reported a rise in first-quarter profit; Sears Holdings fell after the retailer reported a larger loss for the first quarter and Hess advanced after refiner Marathon Petroleum said it would pay about $2.87 billion for the oil and gas producer's retail business. Apple rose to a 52-week high.

"We're heartened that the markets have been able to hold onto yesterday's nice gains. I'm not sure there is any particular driver, with the exception of yesterday's Fed minutes, which showed they are contemplating the next big move in rates, but don't seem anxious to be too aggressive," said Jim Russell, senior equity strategist for US Bank Wealth Management in Cincinnati.

"We got a mixed bag of data, both overnight and this morning, overseas and domestically. And we've had a string of retail announcements this week that have been on the disappointing side of the ledger. We suspect weather was part of it," Russell said.

Thursday's data included the Markit Economics preliminary index of U.S. manufacturing, which rose to 56.2 this month from 55.4 in April. And, an initial purchasing managers' index in China climbed to a five-month high.

Read MoreU.S. factory activity expands in May - Markit

Other reports had sales of previously owned homes rising last month; the Conference Board's index of leading economic indicators gaining in April and more Americans than estimated filing claims for jobless benefits last week.

Investors will "reflect more upon positive economic data out of China than we will the weekly jobless claims numbers," said Art Hogan, chief market strategist at Wunderlich Securities.

Thursday's economic reports "are probably being overshadowed by the dovish comments by the Fed, that they are going to keep rates lower for longer," said Mike Serio, a Denver-based regional chief investment officer at Wells Fargo Private Bank.

"If we continue to get jobless claims numbers like we had today, and there is no inflation in employment costs, don't look for the Fed to raise short-term rates anytime soon," said Serio.

S&P 500

After a 43-point fall and 32-point gain, the Dow Jones Industrial Average rose 10.02 points, or nearly 0.1 percent, to 16,543.08, with Nike leading blue-chip gains.

After rising within 2 points of its record close, the S&P 500 added 4.46 points, or 0.2 percent, to 1,892.49, with utilities and health care the best performing and consumer staples and energy faring the worst of its 10 major industry groups.

The Nasdaq rose 22.80 points, or 0.6 percent, to 4,154.34

The Chicago Board Options Exchange Volatility Index, a measure of investor uncertainty known as the VIX, ended at 11.98, its second lowest close this year.

For every share falling, nearly two gained on the New York Stock Exchange, where 577 million shares traded. Composite volume topped 2.7 billion.

Thedollar gained against the currencies of major U.S. trading partners and the 10-year Treasury yield added 2 basis points to 2.552 percent.

Oilfutures for July delivery fell 33 cents, or 0.3 percent, to $103.74 a barrel and gold futures for June delivery rose $6.90, or 0.5 percent, to $1,295 an ounce.

On Wednesday, U.S. stocks jumped after minutes from the Federal Reserve's last meeting had central bankers discussing ways to normalize interest rates.

"The conversation is clearly shifting from this unprecedented accommodation to policy firming. For equity markets, this is a positive signal, because the economic momentum is more upbeat, but at the same time tightening is not imminent," said Anastasia Amoroso, a Houston-based global market strategist at J.P. Morgan Funds.

Read MoreUS stocks rally as Fed signals no rate hike soon

Factset Symbol Name Value
MKT.CVOL-BATY BATY Composite Volume 1729500000
MKT.CVOL-BATS BATS Composite Volume 2100000
MKT.CVOL-CBO CBOE Composite Volume 805500000
MKT.CVOL-CHI CHICAGO Composite Volume 692300000
MKT.CVOL-EDGX EDGX Composite Volume 1735200000
MKT.CVOL-EDGA EDGA Composite Volume 1727900000
MKT.CVOL-ADF FINRA Composite Volume 1739600000
MKT.CVOL-CIS NATIONAL Composite Volume 1605900000
MKT.CVOL-NYS NYSE Composite Volume 2747100000
MKT.CVOL-ASE MYSE MKT Composite Volume 87600000
MKT.CVOL-PSE NYSE ARCA Composite Volume 622400000
MKT.CVOL-NAS NASDAQ Composite Volume 1827600000
MKT.CVOL-OTC OTC BB Composit Volume 328000000
Total 19038700000

—By CNBC's Kate Gibson

Coming Up This Week:

FRIDAY: New home sales; Earnings from Foot Locker

More From