The NSE Nifty 50 index, which had risen as much as 1%, ended 0.06% higher at 11,101.65. The index pared gains after heavyweights Reliance Industries and HDFC Bank turned negative to end roughly 1% lower.

The S&P BSE Sensex closed 0.07% lower at 37,663.33.

The metals sector climbed 4% to its highest level since March 5 and clocked its best one-day gain since end-April. Thirteen of its 15 constituents ended higher, with Hindalco jumping 8.3% and state-run Steel Authority of India Ltd rising 6.2%

On Tuesday, SAIL reported a 50% jump in July sales, while Jindal Steel & Power saw steel sales rise 29%.

Adding to the upbeat results were mid-sized companies including Sun Pharma Advanced Research and agri-chemcials producer PI Industries that reported strong June-quarter earnings on Tuesday.

Corporate earnings have been far better than originally feared, with company executives no longer clueless about the future as they were at the start of the COVID-19 pandemic around March, said Siddharth Khemka, head of retail research at Motilal Oswal Securities in Mumbai.

"If you see (company) managements talking now, they're saying there's a lot of improvement on a sequential level, with demand going back to 70-80% of pre-COVID levels," Khemka said.

Surging coronavirus cases, however, could cap any gains from earnings, he added.

On Tuesday, COVID-19 infections in India topped 1.9 million, clocking a 50,000-plus rise for the seventh straight day.

Meanwhile, gold jumped to a record high on Wednesday and European and Asian stocks rose.

By Sachin Ravikumar