The headline indices rallied after exit polls showed a likely first-time victory for the Bharatiya Janata Party (BJP) in the key northeastern state of Assam, in a push for its reform agenda.
The 30-share index ended the day at 25,773, up 120.38 points, while broad-based 50-share index quoted 7,890, up 30.00 points at close.
Market breadth remained positive with 17 of the 30 Sensex components ending the day in green.
A win in Assam, a tinderbox of ethnic and religious animosities, would testify to the continuing appeal of the BJP, the ruling party at the centre, in results that are due on Thursday.
The outcome is being closely watched by markets as a potential indicator of the mood of voters in the world's biggest democracy and gives a snapshot of Prime Minister Narendra Modi's performance as he approaches the half-way mark of his five-year tenure.
"BJP is likely to consolidate its position in Assam, which is positive for the government, as it will be able to push forward its reform agenda more strongly," said K K Mital, head of portfolio management, Globe Capital Market.
Global market sentiment also improved, with Asian shares recovering from two-month lows on Tuesday, after a rebound in technology giant Apple Corp and oil price gains boosted Wall Street.
ONGC was the best performing stock on both the benchmark indices and gained 3.75 per cent on the Bombay Stock Exchange (BSE).
Oil marketing companies such as Bharat Petroleum Corp and Hindustan Petroleum Corp rose 2 per cent each on a hike in retail prices of petrol and diesel.
Sobha rose 0.73 per cent after the property developer said it would consider a share buyback during a board meeting on Thursday.
Sun TV Network soared as much as 10.75 per cent after exit polls predicted the DMK-Congress alliance will form the next government in the southern state of Tamil Nadu.
Among the decliners, Tata Coffee dropped as much as 2.6 per cent after it posted a 13 per cent fall in March-quarter consolidated net profit.
Bank of Baroda extended losses after the bank posted on Friday its second quarterly loss due to a surge in provisions.