By Anora Mahmudova, MarketWatch

NEW YORK (MarketWatch) -- A late-afternoon rally on Wall Street led by tech and small companies sent U.S. stocks into positive territory on Friday.

Analysts attributed increased buying in the afternoon to the end-of-quarter rebalancing of portfolios by institutional investors.

Friday's modest gains capped weekly losses on the S&P 500 and Dow Jones. The Nasdaq Composite, which outperformed other markets on Friday, recording a second consecutive weekly gain.

The S&P 500 (SPX) closed 3.90 points, or 0.2%, higher at 1,961.01. The index fell 0.1% for the week.

The Dow Jones Industrial Average (DJI) ticked up 6.36 points to 16,852.49. The weekly loss was 0.6%.

The Nasdaq Composite (RIXF) ended the day up 18.88 points, or 0.4% at 4,397.93. It gained 0.7% over the past week.

The Russell 2000 (RUT) gained 8.79 points, or 0.7%, to 1,189.50. The index, which adjusts its components once a year, rebalanced on Friday, spurring increased trading activity. Why stock volume's going to go crazy at the close.

In Friday's sole release of economic data, consumer sentiment rose to a final June reading of 82.5 from a final May level of 81.9, according to Friday reports on the gauge from the University of Michigan and Thomson Reuters.

Kim Caughey Forrest, senior equity analyst at Fort Pitt Capital, said that despite the consumer sentiment data, consumers are still squeezed.

"Disappointing numbers from retailers should work as a yellow sign of caution that consumers are not getting better. Until we get wage growth and jobs growth, investors should be cautious about the economy accelerating," Forrest said.

Nike Inc. (NKE): The maker of sporting apparel and gear reported stronger-than-expected earnings for the fiscal fourth quarter, as revenue grew across almost all its main markets. Shares rose 1.1%.

Finish Line Inc.(FINL): The sports company posted fiscal first-quarter results that topped forecasts. Shares jumped 1.4%.

GoPro Inc.(GPRO): The maker of digital sports cameras saw its shares jump more than 30% in its first day of trading, closing at $31.34. Shares were up 14%. Read: Is GoPro IPO the next Facebook -- or Twitter? Vote in our poll

Dollar General Corp (DG): The discount store chains said that Chairman and Chief Executive Rick Dreiling plans to retire by next year. Shares fell 7.3%.

The Michaels Cos.(MIK): The arts and crafts retailer was flat on its first day of trading at $17.02 a share. Also read: Mover and Shakers.

In other markets, Asian stocks closed mostly lower, while European benchmarks finished flat and notched biggest weekly loss in two months. Oil(CLQ4) on Friday suffered a second straight weekly loss as worries over the fate of Iraq's oil exports fade and traders weighed healthy domestic U.S. crude supplies. Gold prices (GCQ4) settled higher on Friday, recovering a little from the prior day's decline to tally a mild weekly advance -- their fourth in a row. while the dollar index (DXY) moved lower.

More must-reads from MarketWatch:

6 reasons why stocks are still setting records

Forget stock chatter, pay attention to Treasury yields

The 'father of the VIX' on its 7-year low: Don't worry about it

Subscribe to WSJ: http://online.wsj.com?mod=djnwires

Nike (NYSE:NKE)
Historical Stock Chart
From Mar 2024 to Apr 2024 Click Here for more Nike Charts.
Nike (NYSE:NKE)
Historical Stock Chart
From Apr 2023 to Apr 2024 Click Here for more Nike Charts.