Besides, a strengthening rupee and positive global cues on upbeat US economic data and easing crude oil price also buoyed market sentiments.
The rally helped both Sensex and Nifty rise by over 1.5 per cent this week, their second successive weekly gain.
The NSE Nifty barometer today rose 22.10 points, or 0.28 per cent, to end above the 7,900-mark for the first time at 7,913.20 after software stocks led by Infosys surged. The Nifty also hit a new all-time intra-day peak of 7,929.05, surpassing its previous record of 7,922.70 hit on August 20.
The BSE 30-share barometer spurted 59.44 points, or 0.23 per cent, to close at 26,419.55, just missing previous record closing high of 26,420.67 reached on August 19. During today's session, it touched a high of 26,508.27.
The gauge had gained 45.82 points in yesterday's session.
"Mid-caps out-performed larger peers, indicating greater interest from non-institutional players. Reduced geo-political tensions and optimism on future growth buoyed sentiments," said Dipen Shah, Head-PCG Research, Kotak Securities.
A firming trend in other Asian markets after the US markets closed at another record-high yesterday also helped.
Hindalco was the best gainer today among the 30-share Sensex as it jumped 2.36 per cent.
In the banking space, stocks of SBI, Axis Bank and HDFC Bank witnessed good buying activity.
Sectorally, the BSE IT sector index rose the most by rising 1.63 per cent, followed by Banking 1.03 per cent, Teck 0.97 per cent, Capital Goods 0.16 per cent, Metal 0.16 per cent, Healthcare 0.13 per cent and Auto 0.08 per cent.
Sustained money pumped into markets by foreign investors -the main market mover- was seen across the board. FIIs bought shares worth a net Rs 412.77 crores yesterday as per provisional data from bourses.