For the week, the Sensex gained over 2.1 per cent or 359 points, while the Nifty advanced 116 points. Markets closed higher after three consecutive weeks of losses.
Earlier, the Sensex had slipped over 1 per cent in morning trade amid official signals of a drought like condition in India. Consumer facing stocks such as auto makers and banking stocks, that have a huge exposure to farm loans, were among the worst affected.
However, a sharp rally in European stocks helped lift sentiments. Markets in France, Britain and Spain saw strong gains even though the European Central Bank failed to outline any step to address the debt crisis after its meeting yesterday.
Metal stocks were the biggest outperformers in trade today. These stocks are more sensitive to shocks in the global economy. Shares in steel makers like Tata Steel, state run steel manufacturer SAIL, and JSPL ended 2-2.5 per cent lower.
"These are high beta stocks that tend to decline more... They also have a high degree of financial leverages and in the current environment, leverage is something that is to be avoided, particularly in foreign currencies," Manishi Raychaudhri, strategist and head of research at BNP Paribas Securities told NDTV Profit.
Banking, realty, and auto stocks closed off the day's low. On the Nifty index, 31 of the 50 stocks traded in the red.
Vedanta Group miner Sterlite Industries was the top loser, down 2.5 per cent. Infra lender IDFC and cement maker Jaiprakash Associates were the other big losers, falling over 2 per cent.
Asian Paints was the top Nifty gainer, rising nearly 3 per cent. IT major Wipro also close with over 2 per cent gains. State-run power producer NTPC extended gains to close 1.7 per cent higher.
Among other stocks, Deccan Chronicle snapped a 10-day losing streak to close with gains. The stock has lost over 26 per cent of its value this week.
IT firm Mahindra Satyam closed with over 6 per cent gains after hitting a new 52-week high on the back of strong June quarter earnings.
The market breadth was weak and barely 37 per cent stocks managed to advance on the broader BSE 500 index.
Technical analysts were not too optimistic in their outlook.
"As long as the Nifty fails to take 5,260, it makes sense to hold on to the short positions," Shardul Kulkarni of Angel Broking said.