Investors also regained appetite for beta's especially banks, after indexes had retreated from previous record highs hit on April 3.
Gains also tracked Asian stocks hitting a near six-month high on Wednesday. The MSCI-Asia Pacific excluding Japan index rose 1 percent adding to Tuesday's rise of 0.6 per cent, when markets were closed yesterday.
Shares remain supported by overseas investors, who bought Indian shares worth Rs. 703 crore on Monday, provisional exchange data shows, totalling nearly $4.5 billion so far in 2014.
Trading was momentarily disrupted at the BSE Ltd stock exchange when share prices stopped updating for about 15-20 minutes in morning trade, multiple dealers said on Wednesday. A BSE spokesman said in the morning the exchange could not confirm whether any trading had been disrupted.
"India is benefiting from the fact that there are limited options to invest in emerging markets (EM) today and hence is getting a disproportionate share of the EM flows. In Asia most FIIs are negative on China.
The BSE Sensex rose as much as 1.77 per cent to an all-time high of 22,740.04, surpassing its previous lifetime high hit on April 3. The Nifty rose as much as 1.7 per cent to a record high of 6,808.70.
The benchmark BSE Sensex ended 1.61 per cent higher, while the broader Nifty closed 1.51 per cent up, marking their record closing highs as well.
Sun Pharmaceutical rose 7.12 per cent, its biggest single day percentage gain since May 2009, adding to its 2.9 per cent rise on Monday, as brokers upgraded the stock after Sun agreed to buy Ranbaxy Laboratories for $3.2 billion.
Ranbaxy shares also rallied 4.9 per cent on expectations of potential synergies after the deal with Sun Pharmaceutical.
However, the president of an Indian brokerage association is planning to formally request that India's market regulator investigate trading in Ranbaxy Laboratories shares in the days leading up to its acquisition by Sun Pharmaceutical Industries Ltd.
Bank shares surged 3.5 percent on hopes for easing bond yields and better-than-expected inflation data next week, dealers said.
ICICI Bank rose 4.2 per cent, while HDFC Bank surged 2.3 per cent.
Among state-run banks, State Bank of India rose 3.3 per cent and Bank of Baroda ended 5.6 per cent higher.
In other blue-chips, Reliance Industries rose 1.9 per cent while Tata Motors ended 4.2 per cent higher.
Bharat Forge ended 1.4 per cent higher after earlier rising to its highest level since April 2006 as Goldman Sachs upgraded the auto components maker to "neutral" from "sell" as part of its preference for cyclical shares over defensive ones.
However, software stocks , with Infosys kicking of the quarterly earnings season on April 15.Infosys fell 1.2 per cent, Tata Consultancy Services lost 0.2 per cent, HCL Technologies slipped 1.9 per cent, Tech Mahindra ended down 3.1 per cent, while Wipro fell 0.4 per cent.