FMCG, infra and energy related stocks were in keen demand, while banking counters encountered heavy selling pressure on concerns over asset quality.
The overall sentiment, however, remained edgy ahead of derivatives expiry for the month of April and the conclusion of the US Federal Open Market Committee's (FOMC) meeting later in the day.
After a sluggish start, key indices traded mostly in a tight range amid modest profit-taking after overnight's sharp rally even as earnings were in focus once again for investors.
In the meantime, other Asian markets closed lower as investors stayed on the sidelines ahead of Fed's policy decisions, while European bourses were trading mixed with high volatility.
The Fed is expected to signal a cautious stance and leave the door open for another rate hike in June.
The 50-share index opened substantially lower at 7,942 and swung between a high of 7,991 and a low of 7,940.55 before ending with a modest gain of 17.25 points, or 0.22 per cent, at 7,979.90 -- the highest closing level since January, 1, 2016.
The broader market also saw good follow up buying momentum with mid-cap and small-cap indices gaining 0.21 per cent and 0.62 per cent, respectively.
However, PSU Bank slumped 1.60 per cent, followed by Nifty Bank (0.76 per cent), private bank (0.81 per cent), realty (0.21 per cent), pharma (0.22 per cent) and metal (0.10 per cent).
Major gainers included ITC, Adani Ports, HDFC Bank, Bharti Infratel, ONGC, Infosys, Bharti Airtel, M&M, TCS, Kotak Mahindra, IndusInd Bank, Asian Paints, Gail, HUL and Reliance.
Turnover in cash segment slipped to Rs 17,772.42 crore from Rs 18,283.04 crore on Tuesday.
A total of 8,892.07 lakh shares changed hands in 73,22,705 trades. The market capitalisation of the NSE stood at Rs 96,50,235 crore.
