The country's markets regulator said it "advised the NSE to carry out a detailed root cause analysis," asking it to explain the reasons why trading did not migrate to the disaster recovery site.

The exchange did not immediately say when it would respond when contacted by Reuters.

"Brokers and investors witnessed huge panic in the system," said Rahul Sharma, market strategist & head of research at investment advisory firm Equity99, who was driving to work in downtown Mumbai when he started getting scores of panicked calls from clients.

"At least the resumption gave some relief, otherwise it would have been a disaster."

The NSE, headquartered in India's financial capital Mumbai, is the world's largest derivatives bourse by volume and the third-largest stock exchange globally in terms of the number of equity trades, according to its annual report.

It said telecom disruptions at two of its providers forced the exchange to halt trading earlier in the day, resuming with the NSE Nifty 50 Index gaining 0.39% by 1008 GMT. The stock exchange did not specify the names of the telecom carriers.

The BSE and the NSE said equity and equity derivatives markets would remain open until 1130 GMT, extending the day's session by one and a half hours.

Both indexes ended the session higher, with the some analysts saying stock moves after the resumption of trade reflected frantic trading to square off positions.

"I can't recall trading hours having been extended like this in the past decade. The move will be welcomed as people were completely stuck ahead of the derivatives expiry," said Ajit Mishra, vice-president, research at Religare Broking.

The outage is the latest incident to hit an exchange in the region. In November, Australia's main stock exchange was slammed by a software glitch just 20 minutes into the session.

A month earlier, trading on the Tokyo Stock Exchange was hit by a hardware failure, and earlier, New Zealand's stock exchange was affected by various system glitches.

The NSE outage sent some frustrated traders to the Bombay Stock Exchange. That bourse's daily turnover -- the total value of shares traded -- crossed 400 billion rupees ($5.5 billion) at the close of trade, nine times the turnover in the previous session, exchange data showed.

In January, NSE recorded an average daily turnover of about $10 billion in equities and $498 billion in equity derivatives.

The stock exchange had faced similar system problems in 2017 that led to a five-hour-long shutdown, prompting the market regulator to call for a review of the bourse's contingency plans.

(Reporting by Chris Thomas and Gaurav Dogra in Bengaluru, Savio Shetty and Abhirup Roy in Mumbai; Writing by Nivedita Bhattacharjee; Editing by Rashmi Aich, Sherry Jacob-Phillips and Bernard Orr)

By Savio Shetty and Chris Thomas