After oscillating between the positive and negative territory for most part of the session, key stock benchmark indices ended over half a per cent higher on Tuesday, thanks to buying in the last hour of the trade. The S&P BSE Sensex added 238 points or 0.62 per cent to end at 38,939. During the trade, the index hit a high and low of 38,978.99 and 38,598.72, respectively. ICICI Bank, ITC, Axis Bank, HDFC, YES Bank and TCS were the major contributors to the Sensex's gain. In the broader market, the S&P BSE MidCap index ended at 15,420.48, up 23 points or 0.15 per cent while the S&P BSE SmallCap index ended 15 points or 0.10 per cent lower at 14,972. The NSE's Nifty50 index ended above the 11,650 level at 11,672, up 67 points or 0.58 per cent, with 37 constituents advancing and 13 declining. Sectorally, all the indices except media counter ended in the green. PSU bank stocks advanced the most, followed by realty and auto stocks. The Nifty media index ended flat with the negative bias at 2,410.75, down just 5 points or 0.21 per cent. Shares of Merck hit a new high of Rs 3,990, up 5 per cent in the intra-day trade on the BSE. The stock, eventually, settled at Rs 3,952 apiece, up 3.77 per cent. Panacea Biotec surged 17 per cent to Rs 213 on the BSE on Tuesday after the pharmaceutical and biotechnology company said that India Resurgence Fund (IndiaRF), a fund promoted by Piramal Enterprises and Bain Capital Credit, has invested Rs 992 crore ($144 million) in the company. Shares ended at Rs 200 apiece on BSE, up 11 per cent. IT major Infosys hit a new high of Rs 774 during the trade before settling at Rs 760, down nearly a per cent. Asian Paints ended over 3.50 per cent lower at Rs 1,443.50 apiece after news reports said CLSA has downgraded the stock to 'sell' with the target price of Rs 1,400 from Rs 1,565 earlier.