Indian shares eked out gains in a choppy session on Thursday as a jump in metal and energy stocks helped offset losses in IT major Wipro and private sector banks.

The blue-chip NSE Nifty 50 index  closed up 0.25% at 18,257.80 and the benchmark S&P BSE Sensex ended 0.14% higher at 61,235.30.

Both indexes have clocked gains for five straight sessions and are up more than 5% this year.

"We had a good run in the lead up to IT results, and investors are now reviewing things; as more earnings come in, moves are going to be reactionary instead of (being) proactive," said Anand James, chief market strategist at Geojit Financial Services.

The Nifty metal index  gained a second straight day, adding 3.5%, on the back of firm commodity prices in the global market.

Shares in Tata Steel and JSW Steel rose 6.5% and 4.7%, respectively, and were the top gainers on the Nifty 50 index.

The Nifty energy index extended gains for a fifth session, closing 1.2% higher.

Tech giants Infosys and Tata Consultancy Services  closed up around 1% each, a day after Infosys lifted its full-year revenue outlook and TCS reported a 12.3% rise in quarterly profit.

However, rival IT firm Wipro lost 6%, the most on the Nifty, after posting a near-flat net profit.

Private sector lenders HDFC Bank and Kotak Mahindra Bank  slipped more than 1% each and were among the top losers on the blue-chip index.

Tata Motors  settled up 1% after falling as much as 1.6% earlier in the session, while Nazara Technologies closed up 3% after it said its unit will buy retailer Superhero Brands.

Meanwhile, India recorded 247,417 new COVID-19 cases, the most since late May.

(Reporting by Chandini Monnappa in Bengaluru; editing by Uttaresh.V and Ramakrishnan M.)