NEW YORK — A closely-watched market indicator reached a new high Monday, the latest sign of U.S. investors’ willingness to shrug off global turmoil.

The Standard & Poors 500-stock index, a broad slice of the stock market, rose less than 1 percent, but that was enough to push the index above 2,134.72 – the intraday high set in May 2015. It broke another record by closing above its all-time high of 2,130.82.

“It’s been a long haul” to reach those records, said Mike Mullaney, chief investment officer at Fiduciary Trust Co.

The records are a psychological victory for market watchers rather than a practical one. But it reflects a remarkable turnaround in U.S. markets this year. As the new year commenced, stocks tumbled for weeks as investors fretted over the strength of China’s economy and falling oil prices.

Global equities had all but climbed back from those losses when another shock hit: Britain’s decision to leave the European Union, known as Brexit, sent markets worldwide into another tailspin.

But now oil prices have begun to rise and the weakness in China’s economy does not appear as dire, analysts said. That allowed stocks to claw back into record territory, boosted by investors’ confidence in the relative strength of the U.S. economy despite global turmoil.

For example, the U.S. jobs market added a better-than-expected 287,000 jobs in June, allaying fears that the economy was headed for a sustained slowdown. Also, the turmoil overseas has made U.S. markets a relative safe haven for investors, analysts said.

On Monday, the S&P gained 0.3 percent to close at 2,137.16. The Dow Jones industrial average, which tracks 30 large stocks, rose 80.19 points, or 0.4 percent, to 18,226.93. The tech-focused Nasdaq composite rose 31.88 points, or 0.6 percent, to 4,988.64.

Technology and banking stocks were among those that raced up the fastest. Goldman Sachs and Alphabet, the parent company of Google, were up more than 1 percent. Boeing rose 1.5 percent, making it the best performer on the Dow.

The S&P and Dow are now up nearly 5 percent so far this year. The Nasdaq is still trading in negative territory, but just slightly.

“The fact that we have been able to sustain a rally means that it’s real, it may have legs,” said Brad McMillan, chief investment officer of Commonwealth Financial Network, which manages more than $100 billion in investments.

But mom-and-pop investors should be careful, analysts said. Stocks are still valued highly compared to historical norms and will face another big test over the next few weeks as U.S. companies report their second-quarter revenue and profit figures.

“The average investor should tread with caution. They shouldn’t race to up that exposure” in stocks, McMillan said.

S&P 500 companies are expected to report a 5.3 percent decline in second-quarter profits compared to the same period last year, according to S&P Global Market Intelligence. That would represent the first time since 2009 that the S&P 500 recorded a year-over-year earnings decline in four successive quarters.

A significant decline in corporate profits could unnerve investors, who will be watching closely for indications that Brexit could weigh on U.S. companies.

“Earnings are key. We all know they’re lousy in” the second quarter, said Jack Ablin, chief investment officer at BMO Wealth Management.