The NSE Nifty 50 index closed 0.2% higher at 14,894.9, while the benchmark S&P BSE Sensex gained 0.06% to 49,765.94. Both indexes rose more than 1% each earlier in the session.

The Nifty and Sensex also registered their longest winning streak since early February, even as confirmed COVID-19 cases in India rose above 18 million, with a record rise in infections over the last 24 hours.

Investors, however, have chosen to focus on March-quarter earnings, analysts said. Some major companies including Axis Bank Ltd, ICICI Bank Ltd and Wipro Ltd have so far posted upbeat profits.

Steelmakers Tata Steel Ltd and JSW Steel Ltd were among the biggest gainers on the Nifty 50 on Thursday, surging 6.2% and 9.6%, respectively, to record highs.

This followed China's move to exempt temporary import tariffs for some steel, while removing export tax rebates for most of its steel products.

Reliance Industries, India's largest company by market value, ended 1.3% and was the top boost, ahead of its earnings on Friday.

Bajaj Finance climbed 3.9% and Bajaj Finserv advanced 6.6%, extending gains after reporting strong results earlier in the week.

Larger shadow lending peer HDFC Ltd dropped 1.5% and was the biggest drag on the benchmark index.

Bajaj Auto slipped 1.4%, while Hindustan Unilever was largely flat after their quarterly results. Titan Company is expected to report results later in the day.

The Nifty Auto index dropped 1%.

(Reporting by Chris Thomas in Bengaluru; editing by Ramakrishnan M.)