U.S. stocks gained for a third day on Friday, lifting the S&P 500 to a record finish, as Hewlett-Packard surged and after a better-than-expected report on the sale of new homes in April.
"The housing numbers were good today, so maybe that is helping a little bit. But it's such a thin market that any news that comes out has an expediential effect because people are looking for anything to trade on," said JJ Kinahan, chief strategist at TD Ameritrade.
Home builders including Lennar, D.R. Horton and PulteGroup advanced after the Commerce Department reported sales of new homes rose 6.4 percent in April, halting two months of declines.
"We've had generally weaker housing numbers over the last two months; we'll probably see manufacturing lead the economy as opposed to housing, that shift will likely occur over the next six months to a year," said Paul Nolte, senior vice president, portfolio manager at Kingsview Asset Management in Chicago.
"The market is still holding up well in the face of bad global news like China slowing, and earnings have been so-so at best. We're still correcting the big run-up from last year by trading sideways," Nolte said.
Hewlett-Packard rose after posting quarterly results and saying it could reduce its workforce by as many as 16,000 more jobs as part of CEO Meg Whitman's effort to turn the personal computer maker around.
Aeropostale declined sharply after the teen retailer projected a larger-than-estimated loss for the current quarter.
GameStop gained after reporting first-quarter earnings that beat expectations.
At an economic summit in St. Petersburg, Russian President Vladimir Putin argued that his nation was not at fault in its current stand-off with Ukraine.
Read MorePutin slams sanctions, seeks Eastern tie-up
On Thursday, small-cap stocks advanced and biotechnology shares surged, with the market cheered by the Federal Reserve's prior-day signal that interest rates would remain low for the foreseeable future.
Read MoreSmall-cap shake-up over? Pro says another drop may be looming
Major U.S. Indexes
Rising 0.7 percent from the week-ago close, the Dow Jones Industrial Average gained 63.19 points, or 0.4 percent, to 16,606.27, with Nike front-running gains that extended to 20 of its 30 components.
Advancing to a session high of 1,901.26, above its record close hit on May 13 and less than a point from its intraday record, the ended up 8.04 points, or 0.4 percent, at 1,900.53. Technology led sector gains and utilities led sector losses. The S&P rose 1.2 percent for the week, its first weekly gain in three.
"It usually takes three times to go through these levels; this is time two," said Kinahan of the 1,900 level for the S&P 500.
After a brief and early dip, the Nasdaq rose 31.47 points, or 0.8 percent, to 4,185.81, leaving the technology-laden index 2.3 percent higher for the week.
Volume was slim Friday with many traders breaking early ahead of the three-day holiday weekend, with Wall Street closed on Monday for Memorial Day.
Summer grillin' with FAKE meat?!
"Often the junior varsity is in charge at this point, since a lot of senior traders have headed out," Kinahan said.
For every stock falling, more than two rose on the New York Stock Exchange, where 554 million shares traded. Composite volume surpassed 2.4 billion.
The dollar rose against the currencies of major U.S. trading partners and the 10-year Treasury yield used in figuring mortgage rates and other consumer loans fell 2 basis points to 2.535 percent.
Oil futures rose 61 cents, or 0.6 percent, to $104.35 a barrel; gold futures dropped $3.30, or 0.3 percent, to $1,291.70 an ounce, down 0.1 percent for the week.
|MKT.CVOL-BATY||BATY Composite Volume||1518500000|
|MKT.CVOL-BATS||BATS Composite Volume||400000|
|MKT.CVOL-CBO||CBOE Composite Volume||805500000|
|MKT.CVOL-CHI||CHICAGO Composite Volume||498200000|
|MKT.CVOL-EDGX||EDGX Composite Volume||1524700000|
|MKT.CVOL-EDGA||EDGA Composite Volume||1518100000|
|MKT.CVOL-ADF||FINRA Composite Volume||1526900000|
|MKT.CVOL-BOS||NASDAQ OMX BX||1513300000|
|MKT.CVOL-PHL||NASDAQ OMX PSX||1438700000|
|MKT.CVOL-CIS||NATIONAL Composite Volume||1404600000|
|MKT.CVOL-NYS||NYSE Composite Volume||2404600000|
|MKT.CVOL-ASE||MYSE MKT Composite Volume||77800000|
|MKT.CVOL-PSE||NYSE ARCA Composite Volume||554300000|
|MKT.CVOL-NAS||NASDAQ Composite Volume||1534700000|
|MKT.CVOL-OTC||OTC BB Composit Volume||274100000|
—By CNBC's Kate Gibson
More From CNBC.com: