The S&P 500 closed slightly higher on Friday even though Apple was a drag, as worries about Washington's latest healthcare legislation proposal eased and investors shrugged off concerns about North Korea.
Investors in the broader market were also encouraged by a jump in the Russell 2000 small-cap index, which ended with a record high close.
After a volatile day the S&P's healthcare sector ended 0.1 percent higher as insurance stocks regained ground after Republican Senator John McCain said he opposed his Republican peers' latest effort to replace President Barack Obama's healthcare law.
The S&P technology sector managed to eke out a small gain as investors had more appetite for risk even with a decline of 1 percent in Apple
"The removal of the healthcare overhang, the fact the North Korea market impact is dwindling and the move in the Russell 2000 has all the smart investors thinking that the grind higher continues," said Michael Antonelli, managing director, institutional sales trading at Robert W. Baird in Milwaukee.
The Dow Jones Industrial Average <.DJI> fell 9.64 points, or 0.04 percent, to 22,349.59, the S&P 500 <.SPX> gained 1.62 points, or 0.06 percent, to 2,502.22 and the Nasdaq Composite <.IXIC> added 4.23 points, or 0.07 percent, to 6,426.92.
Some investors moved to safe-haven assets such as gold, after North Korea said it might test a hydrogen bomb over the Pacific Ocean in response to U.S. President Donald Trump's threat to destroy the reclusive country.
But others felt that the market would cope with the ongoing stand-off between the countries, which has been ratcheting up in recent months. "If you cry wolf enough it loses its impact in the end," Antonelli said.
Five of the 11 major S&P sectors ended the day lower and utilities <.SPLRCU> led the decliners with a 0.7 percent loss. After falling as much as 0.5 percent, the healthcare sector <.SPXHC> ended 0.08 percent higher.
Earlier in the day concern about the Graham-Cassidy healthcare bill had wreaked havoc with insurers' stocks. UnitedHealth
The small telecom services index <.SPLRCL>, with only four stocks, was the biggest percentage gainer with a 1.4 percent rise on consolidation speculation while the energy index <.SPNY> rose 0.5 percent as oil futures settled higher. [O/R]
The report also pushed up bigger rivals Verizon Communications
Advancing issues outnumbered declining ones on the NYSE by a 1.82-to-1 ratio; on Nasdaq, a 1.91-to-1 ratio favored advancers.
About 5.26 billion shares changed hands on U.S. exchanges compared with the 6.03 billion average for the last 20 sessions.
(Additional reporting by Caroline Valetkevitch in New York and Sruthi Shankar in Bengaluru; Editing by Nick Zieminski and James Dalgleish)