Mixed cues from regional markets also weighed on sentiment, while gains in some of the underperformers such as Infosys capped the losses.
But foreign investors, who were supporting the 21 per cent gain in the Nifty this year, continued to buy shares worth $115 million on Tuesday, provisional exchange data showed.
Also Read
"There was some profit-booking and it was expected. In the near term, I think the market would trade range-bound with a positive bias," said Suresh Parmar, head of institutional equities at KJMC Capital Markets. "There could be stock-specific movements like that we saw in Infosys on Wednesday. However, the undercurrent is still firm," he added. The BSE Sensex ended 0.4 per cent lower at 25,474. Earlier, it gained 0.6 per cent to a record of 25,736, passing the previous high of 25,711 of Tuesday. The Nifty closed 0.4 per cent lower at 7,627. It rose 0.6 per cent to an all-time high of 7,700, passing its previous peak of 7,683.
Shares in Coal India Ltd ended 3.83 percent lower after gaining 13.4 percent so far this month till Tuesday, while Hindalco Industries Ltd closed 4.2 percent lower after gaining 14.7 percent during the same period.
Shares in Bharat Heavy Electricals Ltd ended 3.4 percent lower after gaining 41.8 percent since May. 1 till Tuesday.
Power producers also lost some ground. Tata Power Co Ltd closed 4.9 percent lower, while NTPC Ltd ended down 3.3 percent.
Real estate stocks continued to fall, with the BSE realty index declining 4.2 percent. Shares of DLF Ltd fell 5.3 percent, while Unitech Ltd declined 7.2 percent.
Shares in India's L&T Finance Holdings Ltd slumped 5.01 percent after the company set a floor price at a discount of 9.7 percent to its Tuesday's close.
However, stocks such as technology and healthcare continued to gain.
Shares in Infosys Ltd gained 3.8 percent in value-buying. The stock has fallen 6.03 percent after the announcement of the general election results on May 16, as against a 7.5 percent rally in the Nifty.
The BSE IT index gained 2.23 percent. Tata Consultancy Services closed 2.3 percent higher, while Wipro Ltd closed up 0.5 percent.