The BSE benchmark Sensex ended in green for the fifth consecutive week on persistent buying mainly in realty, banking and metal counters, on the back of good capital inflows.
Expectations of measures from the government for reviving a slowing economy also boosted the market sentiment.
Continued buying in small-and mid-cap shares by retail investors played a major role in extending the rally. The BSE Mid-Cap index rose by 2.60%, while BSE Small Cap index gained 4.26%, outperforming the Sensex.
The 30-share Sensex rose 91.14 points, or 0.52%, to end the week at 17,521.12. The S&P CNX Nifty of NSE gained 38.05 points, or 0.72%, to settle at 5,316.95.
Sensex has gained 1,555.96 points, or 9.75%, in the last five weeks, while the 50-unit Nifty firmed up by 475.35 points, or 9.82%, in the same period.
Foreign Institutional Investors (FIIs) have bought shares worth net Rs 4,755.70 crore in July 2012 so far (till July 4).
Prime Minister Manmohan Singh, who also holds the Finance portfolio, said last month that he is chalking out plan for the country's economic revival.
"Strong FII fund flows and expectations of measures from the government to boost the sagging economy helped the market to remain firm," said Alex K Mathews, Head-Technical and Derivatives Research, Geojit BNP Paribas Financial Services.