After plunging sharply in the morning trade, the Sensex saw a late-afternoon rally to reclaim the 28,000-point mark and finally ended the day at 28,208.76 points -- up 115.97 points from its previous close.
The NSE's 50-share Nifty also recaptured the crucial 8,500-level.
Financial markets globally saw a turmoil this morning after Greek voters overwhelmingly rejected the bailout package from the country's creditors, which set off panic among the investors in Indian markets as well.
The 30-share Sensex started off sharply lower at 27,857.2 and had hit an intra-day low of 27,774.8 points.
Also Read
The broader Nifty, too, climbed 37.25 points, or 0.44 per cent, to settle at 8,522.15.
The major Sensex gainers included Dr Reddy's, Cipla, HeromotoCorp, TCS and Lupin, while blue-chips like Sun Pharma, ITC, Reliance, Coal India and SBI also recorded gains.
The key losers were Vedanta, Hindalco, NTPC, Tata Steel and Infosys.
The key indices staged a remarkable turnaround towards late-afternoon deals, driven by value buying in frontline blue chips and some bouts of short-covering.
"Indian equity market continues to outperform despite increased global risks in the last couple of weeks. The likely increase in government spending, a possible rate cut are providing hope for Indian markets," said Vinod Nair of Geojit BNP Paribas Financial Services.
Stocks of oil marketing companies rallied for the second straight day as lower crude prices fuelled the climb.
Elsewhere in Asia, barring China, most Asian markets saw heavy selling while European markets traded lower.