The BSE Sensex hit a record high while the NSE index closed just off its all-time high, as steady buying by foreign investors continued to drive a rally in blue chips such as ICICI Bank.
The BSE Sensex's record high of 21,525.14 surpassed its previous historic milestone of 21,483.74 hit on December 9 last year. Nifty ended only 0.2 per cent off its record of 6,415.25 hit on the same date.
The strong rally has defied expectations that foreign investors would grow more cautious as the Federal Reserve continues to withdraw its monetary stimulus and ahead of the general elections set to kick off on April 7.
Instead, overseas investors have bought heavily into India as a sharply narrowing current account deficit and a more stable rupee have increased confidence in a country that only last year was in the midst of its biggest market turmoil since the balance of payments crisis of 1991.
Overseas investors bought Indian shares worth $119.46 million on Wednesday, extending their buying streak to a 14th consecutive day for a net of about $900 million, provisional exchange data showed.
"It's a little more than what we had really expected. Pre-election run up is helping but some short term correction is possible," said Paras Adenwala, managing director at Capital Portfolio Advisors.
The BSE index rose 1.11 per cent, or 237.01 points, to end at 21,513.87, having gained 4.9 per cent since the start of February.
The NSE index gained 1.15 per cent, or 72.50 points, to end at 6,401.15.
The rally comes at a time when foreign investors have been buyers of Indian shares for 14 consecutive sessions for a net total of about $900 million.
India is the only share market after Indonesia to turn positive for the year among the "Fragile Five" economies, or those countries whose large current account deficits were seen as making them particularly vulnerable to foreign outflows.
In India, the current account deficit has narrowed sharply, to 0.9 per cent of gross domestic product in the October-December quarter, according to data on Wednesday, improving sharply from the record high of 4.8 per cent of GDP in the year ended in March 2013.
The improving current account deficit, and the strong foreign inflows, have also boosted the rupee, which is up 12.2 per cent since hitting a record low in late August.
Blue chips have been the main drivers of the rally. On Thursday, ICICI Bank gained 3.1 per cent and Reliance Industries rose 1.9 per cent.
The gains were widespread with the BSE mid-cap index. BSESMC rising 1.21 per cent, including a 3.6 per cent gain in Crompton Greaves.
The small-cap index .BSESC ended up 1.22 per cent.Shares that are part of billionaire Anil Ambani's group were also noticeable gainers: Reliance Infrastructure rose 9.9 per cent, while Reliance Power gained 5.2 perent.
Among stocks that fell, AstraZeneca Pharma India plunged 9.2 per cent after its board late on Wednesday deferred a proposal to delist the company.
Tata Motors (TAMO.NS) also fell 0.3 per cent, adding to Wednesday's 0.8 per cent loss, on profit-taking after marking its record high of Rs 420.70 on Tuesday.