The S&P BSE Sensex extended gains for the second consecutive session on Tuesday, rising 104 points on positive global cues.

The Sensex closed at 25,864 points, up 0.41%, while the 50-share Nifty rose 31 points, or 0.40%, to end at 7,837.

"The stock market in India extended its winning streak for the second consecutive trading session on Tuesday amid a swinging day. Overnight gains in the US and Asian markets lifted the stock market in India during opening trades. However, the indices gave away its gains and slipped into the red only to recover sharply to close slightly off the day's high," said Amar Ambani, Head of Research, IIFL.

On the global front, markets rebounded from a sell-off seen following the terrorist attacks in Paris last week. While China's Shanghai Composite index ended 1.2%, and Hong Kong's Hang Seng index was up 1.4%.

Markets also remain in positive mood ahead of the Winter session of Parliament next week. Finance Minister Arun Jaitley exuded confidence over passing of key tax reform legislation Goods and Services Tax (GST) Bill.

Jaitley said the Narendra Modi government has the required number of votes to pass the GST Bill in the Rajya Sabha.

"The day it is discussed and put to vote in the Rajya Sabha I have not the least doubt it will be approved," Jaitley said in the interview to Bloomberg TV. "We have numbers on our side." 

Meanwhile, official data released on Monday showed the country's trade deficit marginally narrowed to $9.77 billion in October compared to $10.48 billion in September.

Among the BSE sectoral indices, FMCG and Metal were the top gainers, ending 2.1% and 1% higher, respectively.

IT stocks came under selling pressure after India's second-largest IT firm Infosys warned about margins coming down in the third quarter due to a fall in IT spending by companies. Infosys' stock closed 1.7% down at Rs 1,061 on the BSE, to touch a two-month low.

Share prices of private-sector lender ICICI Bank ended marginally higher after the bank said it was selling 6% stake in its insurance venture to an investment firm owned by Wipro chairman Azim Premji and a subsidiary of Singapore's state-owned enterprise Temasek Holdings in a deal worth Rs 1,950 crore.

On the commidty front, gold prices plunged by Rs 450 to close at Rs 25,700 at the bullion market, while silver prices fell sharply by Rs 500 to end at Rs 34,100 per kg.