Nifty Midcap 100 Index advanced 0.7 per cent while the Nifty Smallcap 100 Index ended on a flat note.

The S&P BSE Sensex and NSE Nifty 50 Indexes rose for third day in a row led by gains in banking, metal, energy and oil & gas shares. ICICI Bank, Reliance Industries, Tata Consultancy Services, IndusInd Bank and State Bank of India were among the top movers in the Sensex. Earlier in the day, the benchmarks opened higher but later gave up gains owing to weakness in select FMCG and capital goods shares. Meanwhile, mid- and small-cap shares were trading on a mixed note in afternoon trades.

The Sensex ended 0.42 per cent or 166 points higher at 39,950 and the NSE Nifty 50 Index advanced 0.36 per cent or 43 points to close at 11,966.

Nine of 11 sector gauges compiled by National Stock Exchange ended higher led by the Nifty PSU Bank Index's 1.7 per cent gain.

Metal, Media, Private Bank and Bank sector gauges also rose between 0.75 and 1.3 per cent each.

On the other hand, Nifty FMCG Index was top loser, down 0.2 per cent.

Mid- and small-cap shares ended on a mixed note. Nifty Midcap 100 Index advanced 0.7 per cent while the Nifty Smallcap 100 Index ended on a flat note.

Tata Motors was top gainer in the Nifty 50 basket of shares, the stock climbed nearly 3 per cent to close at Rs 171 after its luxury arm Jaguar Land Rover reported sales for the month of May.

Jaguar Land Rover retail sales in May 2019 were 42,370 vehicles, down 12.2 per cent compared to May 2018, JLR said in a press release.

Yes Bank, IndusInd Bank, Zee Entertainment, JSW Steel, ONGC, Vedanta, HCL Technologies and ICICI Bank were also among the gainers.

On the flipside, Indiabulls Housing Finance slumped 8 per cent to close at Rs 674.15 after a plea was filed in the Supreme Court on Monday seeking legal action against Indiabulls Housing Finance Limited (IHFL), its chairman and directors for alleged misappropriation of Rs. 98,000 crore of public money.

Sun Pharma, Mahindra & Mahindra, Bharat Petroleum, Tech Mahindra, Hindustan Unilever, Dr Reddy's Labs, Bajaj Finserv and Bata India were also among the losers.

The overall market breadth was marginally negative as 960 shares ended lower while 808 closed higher on the National Stock Exchange.