NEW YORK — Stocks around the world climbed on Thursday, and U.S. indexes hit records as markets continued a rally sparked after the United States and Iran appeared to step away from the edge of war.

Money flowed into riskier investments, such as technology stocks, and trickled out of traditional hiding spots for investors when they’re nervous, such as gold. A measure of fear in the stock market had its largest drop in a week.

Stocks have been rallying since Wednesday, after investors took comments from President Donald Trump and Iranian officials to mean no military escalation is imminent in their tense conflict. It was a sharp turnaround from earlier days, when markets tumbled on the threat of war after the United States killed a top Iranian general in a drone strike.

The S&P 500 rose 21.65 points, or 0.7%, to 3,274.70 and surpassed its record set last week. The Dow Jones Industrial Average climbed 211.81 points, or 0.7%, to 28,956.90, and the Nasdaq composite rose 74.18, or 0.8%, to 9,203.43. Both also hit records.

Diminishing worries about a U.S.-Iran war put more of the market’s focus on the economy, corporate profits and other inputs that directly affect stock prices.

“The market is in pretty solid shape,” said Matt Hanna, portfolio manager at Summit Global Investments. “We could see some volatility in the beginning of 2020” following a well-worn path of choppy first halves for stocks during presidential election years, “but we don’t see any sort of recession on the horizon.”

The spotlight will move next to Friday’s labor report, and economists expect it to show employers added 160,000 jobs last month.

Technology stocks powered to the biggest gains in the S&P 500 and accounted for more than a third of the index’s gain. Apple’s 2.1% rise added momentum, and Advanced Micro Devices rose 2.4% for one of the larger gains in the S&P 500.

On the losing end were shares of several big retailers. Kohl’s fell 6.5% for the largest loss in the S&P 500 after it reported weaker sales during the holiday season versus a year earlier. Bed Bath & Beyond plunged 19.2% after its results for the latest quarter fell well short of analysts’ expectations.

Welcome to the discussion.

Keep it Clean. Please avoid obscene, vulgar, lewd, racist or sexually-oriented language.
PLEASE TURN OFF YOUR CAPS LOCK.
Don't Threaten. Threats of harming another person will not be tolerated.
Be Truthful. Don't knowingly lie about anyone or anything.
Be Nice. No racism, sexism or any sort of -ism that is degrading to another person.
Be Proactive. Use the 'Report' link on each comment to let us know of abusive posts.
Share with Us. We'd love to hear eyewitness accounts, the history behind an article.