Nifty recorded its best monthly gains since November 2020, while the rupee surged against the dollar on Friday, as investors bet on a slower pace of US interest rate hikes.
Nifty closed 1.35% higher at 17,158.25 while Sensex rose 1.25% to 57,570.25, with both indices settling at their highest in three months.
In July, the index rose 8.7%, while the Sensex climbed 8.6%, helped by a sharp decline in crude prices that soothed inflation worries. The indices are up around 2.6% each for the week.
Investor sentiment got a boost after a contraction in the US economy for a second straight quarter raised hopes that the Federal Reserve may not opt for aggressive interest rate hikes.
The focus has now shifted to the Reserve Bank of India's policy meet next week, which economists now predict will deliver a smaller rate hike than earlier expected.
The Indian rupee jumped 0.63% to 79.25 per dollar in its best session since August 27, 2021.
Nifty Metal was the best performing stock sub-index, rising 3.9% banking on likely strong demand from top consumer China. Tata Steel advanced 7.2%.
Nifty Auto gained 1.3%, with TVS Motor Co up 4.3% after a reporting strong profit.
SBI Life Insurance rose 8.6% and was the top gainer in the Nifty on a rise in quarterly profit, while drugmaker Sun Pharma jumped 5.4% after beating profit expectations.
Shares of industrial equipment maker GMM Pfaudler climbed 19.1% after reporting a 17-fold jump in quarterly profit.