BENGALURU - Indian shares reversed gains on Wednesday, after hitting record highs at the open, weighed down by a drop in energy and state-owned companies after a recent rally.

The NSE Nifty 50 was down 0.48% at 23,446.15, while the S&P BSE Sensex shed 0.30% to 77,072.77, as of 10:55 a.m. IST.

Both the indexes rose about 0.3% each to hit all-time high levels at the open.

"There could be bouts of profit booking as there is no valuation comfort for investors to buy at current levels, except for some pockets in large-caps and banks," said Sunny Agrawal, head of fundamental equity research at SBICAPS Securities.

Public sector enterprises, which have rallied 15.2% since India's national election results on June 4, dropped 2.1%.

Energy stocks declined 1.6% and realty shed 3.5% on the day. Both indexes had gained about 10% and 18%, respectively, since June 4.

On the day, three of the 13 major sectors logged gains, with heavily-weighted private banks and banks rising about 0.75% each.

Private lender IndusInd Bank gained about 2% after Bernstein initiated coverage on the stock with an "out-perform" rating.

"IndusInd Bank is well positioned for a potential rate easing cycle and has exposure to attractive segments like commercial vehicles and microfinance," Bernstein said in a note.

IndusInd Bank was the top Nifty 50 gainer on Wednesday.

Other private lenders such as ICICI Bank, Kotak Mahindra Bank, and HDFC Bank advanced between 0.5% and 1.5% and were among the other top Nifty 50 gainers.

Small- and mid-caps also rose about 0.4% each to all-time high levels, before reversing gains to drop about 1% each.

Meanwhile, Wall Street equities closed higher overnight, with the S&P 500 and Nasdaq Composite closing at record high levels, as weaker-than-expected U.S. retail sales data signalled cooling inflation and boosted chances of a rate cut in September.

(Reporting by Bharath Rajeswaran in Bengaluru; Editing by Sonia Cheema and Sohini Goswami)