Besides, media reports that Greek Prime Minister Alexis Tsipras is considering a last-minute bailout proposal by the European Commission, lifted market sentiments.
The Sensex opened lower at 27,627.39 and fell further to 27,570.95 on initial selling.
More From This Section
However, it recovered afterwards to 27,814.53 before ending at 27,780.83, showing a gain of 135.68 points, or 0.49 per cent. It had dropped by 250.82 points, or 0.90 per cent, in last two days.
Small-cap and Mid-cap indices also shot up by 1.07 per cent and 1.33 per cent, respectively on fresh buying from retail investors.
The CNX 50-share Nifty also rose (rpt) rose by 50.10 points, or 0.60 per cent, to close at 8,368.50.
Asian stocks ended higher today as investors push off concerns about a default in Greece until the outcome of a referendum on Sunday.
China's Shanghai Composite made a smart recovery after falling as much as 5 per cent today.
Key benchmark indices in Hong Kong, Taiwan, Japan, Singapore and South Korea ended higher by 0.63 per cent to 1.09 per cent.
However, European markets were trading lower as Greece seems set to dafault on a 1.5 billion euro debt payment due to the International Monetary Fund (IMF) today after bailout negotiations broke down over the weekend.
Key indices in France, Germany and UK dropped by 0.93 per cent to 1.17 per cent.