By Sue Chang and Carla Mozee, MarketWatch

However, health-care stocks surrender Thursday's gains

U.S. stocks finished mostly higher Friday as investors scooped up battered energy shares, and technology stocks extended their recent advance, helping the main indexes close out the week on a positive note.

The S&P 500 rose 3.80 points, or 0.2%, to end at 2,438.30 with technology stocks up 0.7% and energy shares adding 0.8%.

The Dow Jones Industrial Average slipped 2.53 points to close at 21,394.76 in an up-and-down session. The tech-heavy Nasdaq Composite Index advanced 28.56 points, or 0.5%, to finish at 6,265.25.

For the week, the S&P 500 posted a weekly gain of 0.2%, while the Dow industrials were mostly flat and the Nasdaq logged a 1.8% weekly climb.

The fact that oil prices held up well considering concerns about a continuing supply glut also helped to buoy the market, said Peter Cardillo, chief market economist at First Standard Financial Co.

U.S. oil futures rose 27 cents, or 0.6%, to settle at $43.01 a barrel.

Bank shares were in focus after the Federal Reserve released the results of stress tests. Still, the Financial Select Sector SPDR exchange-traded fund (XLF) failed to get a lift, slipping 0.4%. The report from the Fed on the health of the banking sector (KBE) was released Thursday, and showed that all 34 banks assessed (http://www.marketwatch.com/story/fed-stress-tests-show-banks-could-withstand-a-deep-downturn-2017-06-22) have "strong" levels of capital and would be able to keep lending even during a severe recession. The second set of results, an outline of which banks may return capital to investors, are due next week.

Health-care shares are marginally down following a rally Thursday. Republican senators released a health-care bill draft (http://www.marketwatch.com/story/senate-republicans-unveil-new-health-care-bill-2017-06-22) that includes cuts to Medicaid and the elimination of penalties for people who don't buy health insurance.

"Today health-care stocks are giving back some of those gains as it looks less likely that the bill will get enough votes to pass the Senate given that four Republican senators have come out in opposition of the bill in its current form," said Kristina Hooper, global market strategist at Invesco. "This is typical of the kind of market gyrations that are likely to be seen going forward in response to the changing fortunes of the Trump legislative agenda."

Stocks had little reaction to flash purchasing managers index readings for June. IHS Markit said its services activity index fell to a three-month low of 53.0 from 53.6 in May, while the manufacturing PMI dropped to a nine-month low of 52.1 from 52.7 in May. A reading of more than 50 indicates an expansion in activity.

In other economic news, the Commerce Department said new-home sales ran at a 610,000 seasonally adjusted annual rate in May. Economists had forecast a rate of 590,000 versus 569,000 in April. See: MarketWatch's economic calendar (http://www.marketwatch.com/economy-politics/calendars/economic).

Fed speakers: St. Louis Fed President James Bullard, speaking at a convention in Nashville, said the Fed can afford to stop raising short-term interest rates (http://www.marketwatch.com/story/feds-bullard-says-time-for-fed-to-pause-on-rate-hikes-2017-06-23) and take a wait-and-see stance to see where the economy is headed and how policy debates in Washington play out in coming quarters.

Cleveland Fed President Loretta Mester, meanwhile, said the Fed must continue raising interest rates to avoid inflation getting out of hand and causing a recession, according to Reuters.

Separately, Fed Gov. Jerome Powell said at a symposium that the Fed may consider overhauling central clearing rules as the current system makes banks vulnerable to risks, Reuters reported.

Stocks in focus:BlackBerry Ltd.(BB.T) sank 12.3% after the software-and-services company swung to an unexpected quarterly profit but its sales fell short of expectations. (http://www.marketwatch.com/story/blackberrys-stock-sinks-as-surprise-profit-offset-by-sales-miss-2017-06-23)

Synchronoss Technologies Inc. shares (SNCR) surged 33% after the private-equity firm Siris Capital Group and its associates offered to purchase the cloud-services provider for $18 a share in cash.

Bed Bath & Beyond Inc. shares (BBBY) dropped 12% after the home-furnishings and accessories retailer late Thursday posted fiscal first-quarter earnings and sales that missed expectations. (http://www.marketwatch.com/story/bed-bath-beyond-shares-tank-after-earnings-sales-miss-2017-06-22)

Portola Pharmaceuticals Inc...(PTLA) jumped 47% on reports the pharmaceutical company received approval for a anticoagulant drug.

Other markets: The ICE Dollar Index , which measures the dollar against a basket of six currencies, was flat and gold settled 0.6% lower.

Stock markets in Asia finished mostly higher, with the Nikkei Stock Average logging a modest gain. European stocks edged down. European Union leaders were meeting in Brussels on Friday, with Brexit a key topic one year after the U.K. voted to leave the bloc.

Read:Brexit's impact on markets and the U.K., 1 year after the vote--in charts (http://www.marketwatch.com/story/brexits-impact-on-markets-and-the-uk-one-year-after-the-vote-in-charts-2017-06-23)

 

(END) Dow Jones Newswires

June 23, 2017 16:45 ET (20:45 GMT)

Copyright (c) 2017 Dow Jones & Company, Inc.