The blue-chip NSE Nifty 50 index ended 0.76% higher at 15,812.35 and the benchmark S&P BSE Sensex rose 0.76% to 52,769.73.
Retail inflation in the country rose less than expected in June at 6.26%, strengthening the view that the central bank could keep policy rates at current levels to support an economy hit hard by the COVID-19 pandemic.
While the monthly inflation print was above the upper range of the central bank's 2%-6% target, price pressures appeared to be easing, economists said.
The Nifty Bank index ended 1.34% higher, its sixth session of gains in eight. Shares of ICICI Bank firmed 2.9%, while HDFC Ltd advanced 2.7% and was among the top boosts to the index.
The Nifty finance index rose 1.48%.
The Nifty realty index was up 0.38% and the Nifty Infra index 0.54% higher. The indexes have so far this year gained 21% and 20%, respectively, as the shift to working from home fuels interest in the sectors.
Drugmaker Sun Pharmaceutical rose 2.2%, helping the Nifty Pharma index close 0.61% higher.
The Nifty Auto index rose 0.57%, driven by gains in Jaguar Land Rover parent Tata Motors, which gained 1.1%.
Meanwhile, the benchmark 10-year bond yield closed down 2 basis points at 6.20%, while the partially convertible rupee ended at 74.4925/5025 per dollar against its Monday close of 74.57.
Sentiment globally also got a boost from better-than-expected Chinese export data that helped global markets touch record levels.
(Reporting by Shivani Singh in Bengaluru; Editing by Aditya Soni)