A sharp rally in crude oil and energy shares lifted U.S. stocks on Friday, but indexes registered losses for the week.
U.S. crude oil CLc1 settled more than 6 percent higher after data showed lower U.S. stockpiles, driving gains of 2 percent in the S&P energy index .SPNY.
In the latest comments from Federal Reserve officials, Fed Chair Janet Yellen said late on Thursday the U.S. economy was on "a solid course," while New York Fed President William Dudley said on Friday a cautious and gradual approach to raising rates was appropriate.
Investor focus should shift next week from oil and the Fed to quarterly reports, said Peter Kenny, senior market strategist at Global Markets Advisory Group, in Berkeley Heights, New Jersey.
"The Street is not expecting much in Q1 earnings, but right now the market is moving as a direct result of dovish commentary from the Fed and crude's ability to rally. That is good news for investors but I'm not sure how long of a shelf life that has," he said.
First-quarter earnings begin in earnest next week with reports from Alcoa (AA.N) and four of the big banks. Analysts are projecting a third straight quarterly decline in earnings at S&P 500 companies, with a 7.6-percent year-over-year decline in profits forecast, according to Thomson Reuters data.
Some strategists, though, expect more companies than usual to beat extremely low estimates, possibly helping stocks gain in the short term.
The Dow Jones industrial average .DJI closed up 35 points, or 0.2 percent, to 17,576.96, the S&P 500 .SPX gained 5.69 points, or 0.28 percent, to 2,047.6 and the Nasdaq Composite .IXIC added 2.32 points, or 0.05 percent, to 4,850.69.
For the week, the Dow and S&P 500 lost 1.2 percent, while the Nasdaq fell 1.3 percent.
S&P 500's weekly loss was its biggest since early February. The index has mostly rallied since mid-February as oil prices rebounded and worries over China eased.
A drop in shares of biotechs and other healthcare companies kept a lid on gains in the Nasdaq and the broader market, with the Nasdaq Biotech index .NBI down 1.1 percent on the day.
Valeant Pharmaceuticals (VRX.N) fell 5.2 percent to $33.67 after Bill Ackman said that the Canadian drugmaker would not sell Bausch and Lomb.
Gap (GPS.N) sank 13.8 percent to $23.85 after the company's disappointing same-store sales for March prompted Citigroup to cut its price target on the stock.
Volume was light. About 6.3 billion shares changed hands on U.S. exchanges, below the 7.1 billion daily average for the past 20 trading days, according to Thomson Reuters data.
Advancing issues outnumbered declining ones on the NYSE by 2,300 to 730, for a 3.15-to-1 ratio on the upside; on the Nasdaq, 1,602 issues rose and 1,205 fell for a 1.33-to-1 ratio favoring advancers.
The S&P 500 posted 18 new 52-week highs and one new low; the Nasdaq recorded 30 new highs and 23 new lows.
(Additional reporting by Chuck Mikolajczak in New York and; Yashaswini Swamynathan and Abhiram Nandakumar in Bengaluru; Editing by Nick Zieminski and James Dalgleish)
This story has not been edited by Firstpost staff and is generated by auto-feed.