Today was the expiry of October derivative contracts.
The 30-share Sensex ended up 49 points at 18,759 and the Nifty gained 14 points to end at 5,705.
In Asia, Japan's Nikkei average rose to a four-week closing high on Thursday, lifted by exporters as the yen weakened on growing expectations that the Bank of Japan would further ease monetary policy next week.
The Nikkei climbed 1.1% to 9,055. The Hang Seng ended up 0.2%, Straits Times gained 0.4%.
However, Shanghai Composite ended down 0.7%.
European shares were trading with marginal gainson on better-than-expected earnings from chemical giant BASF SE and Unilever NV.
The FTSE-100, CAC-40 and DAx were up 0.5% each.
Mortgage lender HDFC ended 2.1% higher at Rs 766 on hopes that the central bank would ease key policy rates at its meet on October 30.
ITC and L&T ended up 0.6% each after both companies recently reported robust second quarter earnings.
ICICI Bank gained 0.6% to end at Rs 1,086 ahead of its second quarter earnings on Friday.
Hero MotoCorp which opened lower in early trades after it reported 27% drop in second quarter profits late Tuesday firmed up after the company said that retail sales during the festival of Navratri topped two lakhs units.
The stock ended up 2.4% at Rs 1,838.
Sterlite Industries ended up 2% at Rs 100 on reporting a better-than-expected 75% year-on-year (yoy) jump in its consolidated net profit at Rs 1,743 crore for the quarter ended September 2012
'You need credibility like Nitin Gadkari's'
Banking, capital goods stocks boost markets
Employees reject Kingfisher offer; Shares fall 4.6%
NEW car launches likely to pep up festive sales
Income Tax dept begins probing Gadkari's companies