U.S. stock markets closed higher on July 9, supported by a strong rally in semiconductor shares that overshadowed concerns over escalating tensions in the Middle East. The Nasdaq Composite led gains with a 1.3% increase, closing at 26,206.89 points, while the S&P 500 rose 0.81% to 7,543.66 and the Dow Jones Industrial Average gained 0.27% to 52,487.41 points.

Investors were buoyed by robust performance among technology and chipmakers, notably Micron Technology, which surged 4.5% after announcing plans to invest over $250 billion in the U.S. through 2035. The move aims to capitalize on growing demand for memory chips integral to artificial intelligence development. Other chip-related companies also saw significant gains: Applied Materials rose 3.2%, and Sandisk jumped 7.6%. Meta Platforms advanced following reports that the company intends to begin producing AI chips as early as September.

The Philadelphia Semiconductor Index (PHLX) climbed 3.06% for a second consecutive session, highlighting the sector’s strength. Information technology was the best-performing S&P 500 sector with a 1.65% increase, followed by consumer discretionary at 1.46%. Seven of the 11 S&P 500 sectors finished higher.

Despite the encouraging market activity, investors remained watchful of geopolitical risks after Iran claimed it struck U.S. military targets in Kuwait, Qatar, and Bahrain in retaliation to U.S. strikes on Iranian positions on July 8. These developments raised concerns about the potential for a prolonged conflict in the Middle East, which could drive inflation higher and weigh on market sentiment.

“This is still very much an AI bull market,” said Ross Mayfield, investment strategy analyst at Baird. However, he noted that the durability of the rally depends on stable oil prices and interest rates, which may be challenged by the recent flare-up in Middle Eastern conflict.

The broader market figures show the S&P 500 is roughly 10% higher for the year but remains just under 1% below its June 2 record close. Analysts forecasting the upcoming earnings season expect an average 24% year-over-year increase in S&P 500 profits, with technology companies contributing significantly.

Economic data released last week indicated resilience in the U.S. labor market, as weekly jobless claims decreased, signaling continued stability despite slower job growth in June. Meanwhile, the Federal Reserve maintained interest rates steady at its June meeting under new Chair Kevin Warsh, though minutes from that session revealed some policymakers favored a rate hike before ultimately agreeing to hold.

Market expectations, as reflected by the CME Fed-Watch tool, assign a high probability of a 25-basis-point rate increase by the Fed in December.

Not all large companies shared in the gains. PepsiCo’s shares declined 3.3% despite better-than-expected second-quarter revenue, while Costco Wholesale dropped 4.2% to a six-month low after reporting slowing comparable sales growth for June.

Overall, advancing stocks outpaced decliners by a ratio of 1.5 to 1 on the S&P 500, though trading volume was subdued at 14.7 billion shares, below the 20-session average of 22.9 billion.

Globally, equity markets also advanced. The MSCI World Index rose 0.72%, while Europe’s STOXX 600 index gained about 0.8%, led by technology and basic resources sectors, which climbed 2.7% and 3.2%, respectively.