Indian shares ended lower on Thursday, after hitting record highs earlier in the session as Prime Minister Narendra Modi scored a thumping victory in the general elections.

Modi's Bharatiya Janata Party was leading in 299 of the 542 seats contested in the lower house of the parliament as of 1013 GMT, official data from the Election Commission showed.

The benchmark BSE index closed down 0.76% at 38,811.39, with investors booking profits after it crossed 40,000 for the first time ever.

The broader NSE index ended 0.69% lower at 11,657.05, having eclipsed 12,000 earlier in the session.

The NSE index rose 64.8% during Modi's first term through Wednesday's close, and the BSE index gained 63.6%.

Adani Ports and Special Economic Zone and Zee Entertainment Enterprises were the top percentage gainers on the NSE index, closing up over 5% each.

Vedanta Ltd closed down 5.4%, while Eicher Ltd settled 4.3% lower.

For midday report see (Reporting By Arnab Paul in Bengaluru; Editing by Subhranshu Sahu)