BENGALURU, Feb 8 (Reuters) - Indian shares were slightly higher on Thursday, having first swung to losses and then reversing course again after the Reserve Bank of India (RBI) kept its key interest rate unchanged for a sixth consecutive meeting.

The NSE Nifty 50 index was up 0.12% at 21,957.20, while the S&P BSE Sensex rose 0.08% at 72,211.15, as of 10:34 a.m IST.

Both the indexes were up about 0.2% each ahead of the RBI rate decision. They swung to losses of about 0.2% soon after the decision before revering to gains again.

The broader and more domestically focussed small- and mid-caps gained 0.2% and 0.6%, respectively.

The RBI's Monetary Policy Committee left the key repo rate unchanged as inflation remained above the central bank's 4% medium-term target.

The monetary policy must continue to be actively disinflationary, RBI Governor Shaktikanta Das said in the policy statement.

Rate-sensitive sectors like fast-moving consumer goods , realty and auto shed between 0.2% and 1%, while financials were little changed.

Energy stocks gained 0.9%, led by a 5% jump in Power Grid Corp of India. The state-run energy transmission company, which is the top percentage gainer on the Nifty 50, posted a rise in third-quarter profit, buoyed by strong power demand.

Public sector banks extended their rally, adding 2.6% after a 3% rise on Wednesday.

Analysts said reasonable valuations and a stable earnings outlook have made the sector attractive in an expensive market. The PSU bank index has jumped about 20% in 2024 so far compared with a 1.2% rise in the Nifty 50, helped by strong earnings from key constituents like Bank of Baroda and Punjab National Bank. (Reporting by Bharath Rajeswaran in Bengaluru; Editing by Dhanya Ann Thoppil, Varun H K, Sonia Cheema and Sohini Goswami)