BENGALURU, Dec 31 (Reuters) - Indian shares ended flat on Thursday, finishing a pandemic-ravaged year in which the equity benchmarks battled economic uncertainties to come out stronger, thanks to vaccine optimism and a slew of liquidity support measures.

The benchmark NSE Nifty 50 index rose 14.9% to clock its best year since 2017, while the S&P BSE Sensex gained 15.75%.

The Nifty was flat at 13,981.75 after rising briefly to life-time high of 14,024.85 and the Sensex closed 0.01% higher at 47,751.33 on Thursday, as losses in IT firms and Reliance Industries offset gains in private sector lenders.

"Calendar year 2021 will be marked with hopes of early roll-out of the COVID-19 vaccine, normalisation of activities and unperturbed growth recovery," Jaideep Hansraj, MD and CEO of Kotak Securities said in a note.

The gap between large-cap shares and their smaller peers was sharp. The BSE MidCap index gained 19.87% this year, while the BSE SmallCap index jumped 32.11%.

The Nifty IT index rallied 55% in 2020, logging its best year since 2013, while the Nifty Phrama index logged a 60.6% rise.

Financials were among the worst performers this year, with the Nifty PSU bank index sliding more than 30%.

On Thursday, the IT index closed down 0.32% and the Pharma index settled 0.72% higher.

Tata Consultancy Services and Reliance Industries Ltd closed down 1.6% and 0.51%, respectively, and were the top drag on the Nifty.

Private sector lenders were the top boost as HDFC Bank Ltd closed 0.27% higher and ICICI Bank Ltd added 1.1%.

Meanwhile, hopes of a speedy economic recovery in 2021 amid COVID-19 vaccine rollouts kept global investor mood upbeat. (Reporting by Chandini Monnappa and Nallur Sethuraman in Bengaluru; Editing by Arun Koyyur)