NEW YORK (Reuters) - 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.

Traders work on the floor of the New York Stock Exchange (NYSE) in New York, U.S., September 21, 2017. REUTERS/Brendan McDermid

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 AAPL.O shares on muted reactions to the iPhone maker's latest product launch.

“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 UNH.N closed down 1.1 percent after falling as much as 3.6 percent earlier in the day.

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]

T-Mobile TMUS.O gained 1 percent after Reuters reported that the cellphone network operator was close to agreeing tentative terms on a deal to merge with Sprint S.N, whose shares jumped 6.1 percent.

The report also pushed up bigger rivals Verizon Communications VZ.N and AT&T Inc T.N, which could benefit from having one less competitor.

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.