Investors are piling into tech stocks again.
As a fragile cease-fire holds in the Middle East and AI disruption fears fade, investors are finding a surprise safe harbor in everything from semiconductors to enterprise software.
On Thursday, the S&P 500 and Nasdaq composite climbed to fresh record highs, extending a weeklong rally after President Trump said Israel and Lebanon have reached a 10-day cease-fire agreement and that the U.S. might hold discussions with Iran this weekend.
The S&P 500 gained 0.3%, while the Dow Jones Industrial Average rose 0.2%, or 115 points. The tech-focused Nasdaq composite added 0.4%, marking its 12th consecutive winning session, the index's longest streak of gains since 2009.
The PHLX semiconductor index, which includes such AI darlings as Nvidia, Advanced Micro Devices and Broadcom, also climbed for its 12th straight session, gaining about 1%.
Since the war began, the energy sector has outperformed on the back of surging oil prices.
Recently, the spotlight has shifted to tech stocks. The sector is staging a comeback as investors move past previous anxieties over the potential economic implications of artificial-intelligence advances.
The tech-led surge has been a windfall for hardware giants, with Intel, Sandisk and Micron Technology standing out as the rally's top performers. Shares of Intel, Sandisk and Micron Technology have surged 66%, 61% and 42%, respectively since March 30, when the S&P 500 closed at its lowest level of the year.
Intel, which has struggled in recent years, recently joined with Elon Musk-led SpaceX and Tesla to build specially designed chips. Micron, the largest U.S. memory-chip maker, reported that its quarterly revenue nearly tripled as AI-related demand for memory is outpacing supply. Similarly, flash memory maker Sandisk said AI has been driving more demand than it can keep up with.
Jay Hatfield, chief executive officer at Infrastructure Capital Advisors, said he remains bullish on the tech sector despite the war-fueled energy spikes. He argues that tech companies aren't energy-intensive manufacturers, and many of them are asset-light global giants that remain largely insulated from oil-price volatility.
His hedge fund has been recommending tech stocks such as semiconductor company Marvell Technology, which has soared 52% since March 30.
"Tech stocks are the ultimate safe haven," said Hatfield, who expects the rally to continue should there be a resolution to the war.
Oil prices advanced Thursday, with Brent crude ending the day 4.7% higher at $99.39 a barrel. The Strait of Hormuz remains largely closed, with only a trickle of ships -- most of them Iran-affiliated -- moving through the key shipping lane and the U.S. saying Thursday that it had expanded its blockade of Iran to "all ships, regardless of nationality."
Some investors say tech's return to favor is partly a result of the recent valuation reset. The sector's pullback has brought the multiples of the once highly priced leaders back to more attractive levels. And while the next wave of big tech earnings is still more than a week away, high growth expectations continue to give investors confidence.
"We had valuations come down at the same time as earnings growth is still expanding," said Patrick Ryan, chief investment strategist at Madison Investments. "It's just kind of a perfect storm to get a pretty sizable snapback."
Still, some of the recent gains in tech, particularly within the software area, might be driven by short covering, analysts say. This occurs when investors who previously bet against these stocks must buy back shares to close their positions, driving additional demand and lifting prices.
The average short interest in U.S. software stocks has edged down to about 3.6% of their total shares available for trading, compared with around 3.8% at the end of March, according to data analytics company S3 Partners.