Investor sentiments remained upbeat tracking global developments as the US, China geared up for trade talks due this week.
The NSE Nifty too recovered over 100 points, or 0.96 per cent, to end at 10,576.85.
A declining rupee, elevated crude oil prices and sustained foreign fund outflows added to the gloom
Muted quarterly earnings, mixed cues from global markets and unabated foreign fund outflows added to the volatility
In the longest losing streak of 2017, the BSE Sensex has lost 1,270 points, or 3.91 per cent. It fell to a three-month low of 31,154.03 on Wednesday.
The BSE Sensex moved up 103 points to 35,319.35, while the wider NSE Nifty finished at 10,741.70, up 23.90 points.
The 30-share Sensex, after opening on a strong footing, continued its upward march to hit an all-time high of 35,827.70. The NSE Nifty also hit a record intra-day high of 10,975.10, before finishing at 10,966.20, up 71.50 points.
The broader NSE Nifty gained 22 points to 10,480.60
The 50-issue NSE Nifty too cracked the 10,200-mark and hit a low of 10,108.55 before finishing 104.75 points, or 1.02 per cent down at 10,121.80.
Muted global trend after a report that US President Donald Trump was preparing to impose more tariffs on China hurt trading sentiments.
Among the gainers, Sun Pharma topped by rising 3.03 per cent as the weak rupee tempted buyers to accumulate shares of pharma exporters.
Sun Pharma was by far the biggest gainer in the Sensex pack, surging 8.13 per cent, followed by Dr Reddy's at 4.92 per cent.
The BSE Sensex zoomed 318 points to end at 33,351.57, while the broader Nifty spurted 88 points to 10,242.65.
Fresh buying by domestic institutional investors and better-than-expected June quarter results from some blue-chip companies boosted investor sentiment
Banking stocks felt the heat due to worries that the lending rate cuts will hit their bottom line
Most of the session's gains for both the indices were wiped out as investors rushed to book profits ahead of F&O expiry on Thursday and also due to concerns over stretched valuations.
The Sensex and Nifty remained above their key levels of 36,000 and 10,900 throughout the session, indicating strong investor optimism after a prolonged spell of caution.
Bajaj Auto was the top gainer in the Sensex pack, surging 3.95 per cent followed by Maruti Suzuki at 2.69 per cent.
Gains in key IT, capital goods, healthcare and metal stocks, after consistent buying by domestic and foreign investors, helped both the key indices to scale new peaks.
Tata Steel was the day's worst performer in the Sensex pack, plunging 3.25 per cent, followed by Bharti Airtel at 3.05 per cent.
Sun Pharma dipped 2% to Rs 615 on the BSE, its lowest level since November 9, 2016
The hectic buying by domestic institutions, as also by some top-shot brokers in their proprietary accounts, was in sharp contrast to heavy selling of stocks by foreign portfolio investors
HSBC maintained "overweight" rating on Indian equities, saying "fundamentals are strong".
The broader Nifty too fell for the second straight session and closed with a loss of over 62 points, or 0.54 per cent, at 11,520.30, after hovering between 11,496.85 and 11,602.55.
The broader NSE Nifty closed below the 10,600 mark by plunging 98.15 points, or 0.84 per cent, to 11,582.35 after shuttling between 11,567.40 and 11,751.80.
The Nifty has gained 2.6% so far this week, while the Sensex has climbed 2.85%
The market sentiment was also impacted by mixed global cues as setbacks for a healthcare overhaul in the US raised doubts over prospects for a range of reforms backed by President Donald Trump.
It won't be an easy ride for the markets, reckon experts, considering the multiple state elections in 2018 and general elections next year.
Saurabh Mukherjea, CEO, Ambit Capital, says he is advising clients to either take a genuinely long-term view on stocks or diversify the portfolio with stocks, bonds and gold for those with a short-term view.
Demonetisation, Donald Trump's surprise victory in the US presidential elections, and the fear that US Fed may hike rates in the upcoming policy review in December have dented market sentiments, report Puneet Wadhwa & Deepak Korgaonkar.
The 30-share Sensex ended down 66 points at 28,438 and the Nifty ended down 15 points at 8,633.
Investors widened their bets on optimism that upcoming general budget -- to be unveiled next month - would contain incentives for corporates, which will help boost the economy
'The true fruits of the attack on black money, what Raghuram Rajan did for the banking system, and what technology is doing for us will come in FY19, which, not surprisingly, is the year running up to the next Lok Sabha elections.'
Rebound in IT majors TCS and Infosys in late trades helped markets end higher.
The Sensex ended higher by 245 points at 27,372 mark and the Nifty gained 66 points at 8,225.
Experts believe volatility is here to stay for some time, at least till China stabilises and clarity regarding the US Fed's interest rate move emerges.
Large-cap scrips are still trading at a discount to mid-caps.
The 30-share Sensex ended higher by 30 points.
Caution prevailed across the bourses ahead of the Union Budget.
Overall market benchmark Sensex is headed for its worst performance in four years with a decline of 1,650 points