Indian shares rose in the last trading session of 2016 and were set to post a yearly gain as they recover from the final quarter's losses, which took the shine off the gains made earlier in the year.
The Nifty was set to gain about 3 percent and the BSE index about 2 percent in a year that was marked by volatility from global events including Britain's vote in June to exit the European Union and the U.S. election victory of Donald Trump in November. This year's gains would mark a recovery from a decline recorded in 2015.
At home, the approval of the goods and services tax bill earlier this year helped boost sentiment, but that was offset later by the government's move to scrap higher-denomination notes, raising concerns about economic growth.
But analysts sounded optimism for the new year, with the Reserve Bank of India expected to cut rates at its next policy review in early February and the government gearing up to issue the annual budget.
"Markets remain in comfortable zone, most of the lull was over in the last month," said Deven Choksey, managing director of KR Choksey Securities.
"Market is expecting positive outlook from budget in subsequent months."
The Nifty was up 0.91 percent at 8,176.35 as of 0639 GMT on Friday, heading for a gain of 2.3 percent for the week, its biggest since the week ended on Nov. 18.
The Sensex was up 0.98 percent at 26,625.99, heading for a weekly gain of 2.1 percent.
Both indexes, however, were down for the month, with the BSE down 0.2 percent and the NSE down 0.6 percent.
Among NSE's members, Hindalco Industries was the top gainer for the year, followed by Yes Bank and Tata Steels.
By contrast, Idea Cellular Bharat Heavy Electricals and Aurobindo Pharma were the top decliners.
The Nifty IT index, which fell nearly 8 percent this year facing the brunt of Brexit, was up 0.68 percent on Friday, with Just Dial and Tata Elxsi rising about 2 percent each.
The Nifty Bank index which rose about 7 percent this year as of Thursday's close, was trading 0.76 percent higher on Friday.
Across the sectors, autos and financials were among the biggest gainers while IT stocks were among the decliners for the year.
(Reporting by Tanvi Mehta in Bengaluru; Editing by Amrutha Gayathri)