The Nifty opened marginally higher and trended up, supported by buying in heavyweight Reliance Industries, ONGC, ICICI Bank and Larsen & Tourbo.
The S&P CNX Nifty touched a high of 5422 in the afternoon trades and closed near day's high at 5,412, up 63 points. The Sensex was up 197 points, at 18,045.
Markets bounced ahead of expiry because they were oversold on the technical charts.
However, analysts expect the markets to remain weak going into May series because put call ratio, a ratio of the trading volume of put options to call options which is used to gauge investor sentiment is below 1.2 which indicates bearish sentiment.
Ashish Chaturmoha, Vice President (Derivatives & Technical Analyst) IIFLWealth said call writers may continue to remain aggressive in the market till Nifty trades below 5550 levels.
Food inflation data for week ending May 14 was reported at 8.55% as against 7.47% in the previous week. An upward trend in inflation may weaken the market sentiment and interest rate sensitive sectors may continue to underperform the market.
Foreign institutional investors have sold equities worth $1.74 billion (Rs 7,791 crore) in the Indian markets in the month of May, according to data compiled from the Securities & Exchange Board of India.
The FIIs have been net sellers because they are worried that high inflation and interest rates may dent country's growth prospects.
The Dollar which was weighing heavily on equities and commodities eased to 75.26 from the recent high of 76.2 bringing relief to commodity related sectors across Asia.
Hong Kong's Hang Seng was up 0.7% helped by resource shares.
The Nikkei Stock Average surged 1.5% supported by gains in energy shares.
China's Shanghai Composite index bucked trend, was off 0.2%.
Back in India BSE Oil & Gas shares were the top gainers, the index was up 2.9% on reports that government might reduce the subsidy burden if the government hikes diesel and cooking fuel prices.
ONGC rallied 4.4%, RIL added 2.9% on reports that the company will be free to price its gas for non-core users, Gail India advanced 2.8% and Petronet LNG was up 2.5%.
BSE metal shares also added sheen after Tata Steel net profit surged 72%
Why next few days are vital for the stock market
Markets end near day's high
Vedanta says govt should not link royalty to deal
Govt unlikely to take French auction route
RIL to partner more global players: Mukesh