The Sensex closed at 77,984.38, up 1,078.87 points or 1.40 per cent, while the Nifty settled at 23,658.35, gaining 307.95 points or 1.32 per cent