(Bloomberg) -- Optimism is returning for India’s information-technology companies as easing odds of a recession in the US and the emergence of artificial intelligence as a potential new source of revenue drive a rebound in their stocks.

The NSE Nifty IT Index has climbed 18% from an April low, adding about $46 billion in market value. The 10-member gauge has turned the rally up a notch in July, and is on track to outperform the MSCI World Information Technology Index for the first time in seven months. Gains picked up after Asia’s biggest software services exporter Tata Consultancy Services Ltd. last week reported better-than-expected profits for the latest quarter.

The rebound in tech shares has put them back on track with the broader rally in Indian stocks as investors target sectors that lagged and are available at cheaper valuations. The Nifty IT gauge is trading at about 23 times estimated earnings for the next 12 months, up from about 20 times in April but still below its all-time high of 32 times.

While TCS said some clients are delaying spending, the profit beat helped dispel concerns over the impact of economic slowdowns on global customers that plagued the industry earlier this year. The company and peers that have already reported also provided reassurance over profitable offerings in automation and other emerging technology.

“The flavor of the quarter was generative AI,” Tata Consultancy CEO K. Krithivasan said on the company’s earnings call last week. “In every conversation I have had with clients over the last three months, this has unfailingly come up.”

Still, that newfound optimism likely took a hit Thursday after Infosys Ltd. cut its annual sales forecast, with Chief Executive Officer Salil Parekh saying the software services exporter is seeing some clients either stopping or slowing down “work on transformation programs and discretionary work.” The firm had previously warned about customers in sectors such as finance pulling back amid fear of recession in the US and Europe.

US-listed shares of Infosys fell as much as 13% after the results, their biggest intraday drop since March 2020.

READ: Infosys Cuts Sales Forecast as Companies Curtail IT Spending (2)

The selloff in software exporters earlier in the year was due to lower volumes of discretionary projects in the US, but June quarter performance has not been as bad as feared, said Patricia Urbano, a Paris-based fund manager with Edmond de Rothschild. AI could be better for the sector than had been expected, she added.

Profits at Wipro Ltd. actually came in slightly below consensus estimates but margins were seen as steady, and the firm announced a $1 billion plan to boost its AI business. Concerns are not completely out of the way for the sector, however, as evidenced by a spike in short positioning in shares of Infosys ahead of its results.

While estimated 12-month forward earnings for the Nifty IT index have dipped this month to about 1,350 rupees per share, they remain above the April low of around 1,330 rupees per share and 1,270 at the start of the year. The sector’s solid profitability and efforts to reward shareholders have helped lure investors back.

The software exporters are “returning capital to investors with lots of dividends and buybacks,” according to Mark Matthews, head of Asia-Pacific research at Bank Julius Baer & Co. “It was a good correction to enter the space.”

Elsewhere in corporate earnings:

--With assistance from Satviki Sanjay.

(Update with details on Infosys results, US earnings charts.)

©2023 Bloomberg L.P.