The domestic stock markets climbed in early trade on Thursday but later gave up all the early gains to trade lower amid muted global trends and continuous foreign fund outflows.

The monthly derivatives expiry also added to the volatile trends in the markets.

The 30-share BSE Sensex climbed 287.32 points to 66,406.01 in early deals. The Nifty advanced 50.2 points to 19,766.65.

However, both the benchmark indices failed to carry forward the winning momentum and traded in the negative territory later. The 30-share BSE benchmark traded 64.71 points lower at 66,053.98 and the Nifty quoted 14.20 points down at 19,702.25.

Among the Sensex firms, Larsen & Toubro, JSW Steel, Axis Bank, Tata Steel, Sun Pharma and State Bank of India were the biggest gainers.

Also read: Rupee trades flat against US dollar amid gains in equities

Tech Mahindra, Asian Paints, Hindustan Unilever, Bajaj Finance, ITC and Kotak Mahindra Bank were the major laggards.

In Asian markets, Shanghai quoted in the green while Tokyo and Hong Kong traded lower.

The US markets ended on a mixed note on Wednesday.

"Even though the market is showing resilience, the undercurrent is weak. The dollar index at 106.59, the US 10-year bond yield at 4.62 per cent and Brent crude above $97 are strong headwinds that can pull the market down," VK Vijayakumar, Chief Investment Strategist at Geojit Financial Services, said.

Global oil benchmark Brent crude climbed 0.71 per cent to $97.24 a barrel.

Foreign Institutional Investors (FIIs) offloaded equities worth ₹354.35 crore on Wednesday, according to exchange data.

"The rising US bond yields on the back of the firm dollar index has resulted in foreign fund outflows in the month so far. However, India's structural growth and key indicators would mean that investors cannot be bearish on local markets for long," Prashanth Tapse, Senior VP (Research) at Mehta Equities Ltd, said.

The BSE benchmark had climbed 173.22 points or 0.26 per cent to settle at 66,118.69 on Wednesday. The Nifty gained 51.75 points or 0.26 per cent to end at 19,716.45.