Besides, a firming trend overseas after European Central Bank announced stimulus measures, accelerated fund flows into emerging markets like India, brokers said.
Intra-day, the BSE Sensex rallied to an all-time high of 25,419.14, surpassing previous high of 25,375.63. It closed at a new high of 25,396.46, logging a gain of 1.51 per cent or 376.95 points -- its best single-day rise in over three weeks.
The Sensex's previous all-time intra-day high of 25,375.63 was hit on May 16, the day election results showed the BJP had clinched a landslide victory in Lok Sabha polls.
Nine of the twelve of the sectoral indices ended in the green. Realty, oil&gas and banking shares led the surge.
The NSE Nifty touched a new life high of 7,592.70, breaching the earlier high of 7,563.50. It closed up 109.30 points, or 1.46 per cent, to end at new high of 7,583.40.
The Nifty's previous all-time intra-day high of 7,563.50 was also hit on May 16.
"Oil ministry is likely to take decision on gas pricing by month-end, generating renewed buying in the sector.
Positive news about Monsoon also boosted market sentiment," said Rakesh Goyal, Senior Vice President, Bonanza Portfolio.
Onset of Monsoon is expected to ease prices of food grains, helping RBI to control sticky inflation, say experts.
Investors heavily bought oil&gas shares after reports said the government is likely to hike natural gas rates from July 1 after a new price formulation is approved by the Cabinet. Among Sensex, ONGC shot up nearly 11 per cent and RIL gained about 3 per cent. GAIL, out Sensex, rose 7.5 per cent.
Of the 30 Sensex scrips, 24 ended higher, while six led Infosys, Hindualco, Sesa Sterlite, Bharti Airtel, Tata Consultancy Services and Coal India ended lower. Shares of Infosys fell 1.28 per cent following exit of a key executive.
Sectorwise, BSE realty index gained the most by rising 5.02 per cent, followed by Oil and gas index up 4.82 per cent and Banking index that jumped 1.65 per cent.
Indian shares surge to record high; ONGC up 11 pct
(Reuters) Indian shares surged to a record high on Friday as blue-chips including oil and gas companies rose on continued optimism about policy reforms by the new government.
Upstream oil and gas companies led the rally on expectation that the new business-friendly government of Prime Minister Narendra Modi would usher in substantial reforms.
Local shares were also underpinned by foreign fund inflows into equity markets for the fifth straight session on Thursday. Overseas investors bought shares worth 13.69 billion rupees ($230.8 million) on Thursday, provisional exchange data showed, taking their total purchases to $8.3 billion so far this year.
"The market is in a bull run and the momentum is expected to continue. Large overseas funds, which are coming into the market, are looking for quality companies with inherent strength such as ONGC. Most of the state-run companies are performing and are getting rerated. There could be intermediate corrections, which are good for the markets," said Deven Choksey, managing director, KR Choksey Securities.
The benchmark BSE index gained as much as 1.6 percent to hit an all-time high of 25,419.14. The index closed 1.51 percent higher at 25,396.46, posting a 4.9 percent gain for the week.
The broader NSE index surged as much as 1.59 percent to a record high of 7,592.70. The index closed 1.46 percent higher at 7,583.40, marking a 4.9 percent rise for the week.
Shares of Oil and Natural Gas Corp gained as much as 12.1 percent to an all-time high of 469.85 rupees. The stock closed 11.1 percent higher at 465.65 rupees, adding to the 1.9 percent gain on Thursday, amid continued hopes about reforms in the sector.
Shares in other oil and gas companies also gained with the BSE's oil and gas index closing 4.82 percent higher.
Reliance Industries Ltd advanced 2.98 percent, adding to its 1.2 percent gain on Thursday. Oil India Ltd rose 3.92 percent, while Gail India Ltd gained 7.94 percent.
Bluechips such as Housing Development Finance Corp rose 2.9 percent while Hero MotoCorp Ltd gained 3.9 percent.
State Bank of India closed 1.6 percent higher, while Mahindra and Mahindra Ltd ended up 2.5 percent.
Shares in other banks also gained. Kotak Mahindra Bank Ltd ended 3.9 percent higher, while Punjab National Bank closed up 2.7 percent.
Shares in sugar companies gained after the union food minister said India would examine raising import tax on the sweetener to support local prices and help mills clear dues to cane growers.
Shares in Shree Renuka Sugars Ltd gained 13.3 percent, while Balrampur Chini Mills Ltd closed 7.5 percent higher.
However, technology stocks declined with Infosys Ltd falling 1.3 percent after one of its top executive resigned. Tata Consultancy Services Ltd closed 0.95 percent lower.
* BSE index gains 1.51 pct; NSE ends 1.46 pct higher
* BSE and NSE indexes rise 4.9 pct each this week
* FIIs continue to buy for a fifth straight session
FACTORS TO WATCH
* Euro holds strong after ECB moves, U.S. data dominates
* Brent oil rises above $109, buoyed by economic optimism
* Asia up, Europe more cautious as payrolls loom
* Foreign institutional investor flows