The NSE index marked its longest losing streak in nearly 4 years.
IT stocks were the biggest drag, with the sectoral index finishing 2.1 percent lower. Tata Consultancy Services Ltd, the top drag on the NSE index, closed down 3.3 percent. There are also growing expectations of more reflationary policies from some of the world's more powerful central banks.
"This is kind of a relief rally after days of falls. There are no positive triggers with the US market also shut on Monday," said Saurabh Jain, assistant vice-president (research), SMC Global Securities.
The NSE index gained after seven days of losses, while the BSE index snapped eight days of falls on Tuesday.
The Reserve Bank of India's (RBI) decision to hand the government an interim dividend may also have spurred optimism, as a spending boost before the general election will aid companies in the consumer space, Jain said.
Index-heavyweights Reliance Industries Ltd and ICICI Bank Ltd led the gains on the NSE index, rising as much as 1.3 percent and 2.4 percent, respectively.
Realty stocks also advanced, with the Nifty Realty index gaining as much as 2.8 percent to a two-week high. Prestige Estates Projects Ltd surged more than 8 percent and DLF Ltd spurted 4.8 percent.