Volatility was observed as rising Covid cases capped any major recovery attempts on the back of healthy Q4FY21 results.
However, a bout of late session profit booking led both the indices to end on a flat-to-positive note.
Global cues were positive as corporate earnings beat estimates so far and US and Chinese economic data point to a robust recovery.
On the domestic front, prediction of a healthy to normal rainy season this year was released by the state-run and a private weather forecaster. The forecast cheered investors as it will accelerate the growth of not just India's majority rain-fed agriculture sector, but that of cement, two-wheelers, automobile, tractors, farm machinery, infrastructure sector, consumer durables and others.
India VIX fell down by 2.33 per cent from 20.89 to 20.40 levels.
Except financials, all other sectoral indices, led by pharma, media, auto and IT, ended in the green.
The S&P BSE Sensex closed at 48,832.03, inched higher by 28.35 points, or 0.06 per cent, from its previous close.
The Nifty50 on the National Stock Exchange traded at 14,617.85, up 36.40 points, or 0.25 per cent, from its previous close.
"Nifty gained in the first hour of trade, remained in a range till 1430 hrs and then sold off," said Deepak Jasani, Head of Retail Research at HDFC Securities.
"India's South West Monsoon for 2021 is expected to be normal at 98 percent of the long-period average... This will be the first normal monsoon in three years after two above-average monsoon rainfall in the last two years, which is welcome news for an economy dented by a second 'wave' of Covid-19 cases and reduced activity due to localised curfews and lockdowns."
Siddhartha Khemka, Head, Retail Research, Motilal Oswal Financial Services, said: "Equity markets remained positive during most part of the session led by positive global cues but witnessed profit booking towards the fag end to end flat."
"Nifty ended with marginal gains as the continued surge in Covid cases and fresh restrictions by various state governments continue to worry the market. However, with the government's speedy approval for other vaccines, there are hopes of a pick up in the vaccination process which is somewhat allaying the fears. Even normal monsoon projections somewhat cheered the market."
Vinod Nair, Head of Research at Geojit Financial Services said: "Strong positive cues from the global market lent optimism to the Indian market, leading to robust recovery though volatility and underperformance were noticed at the end of the day due to concerns over lockdown."
"As soon as India is able to show a drop in infection rate, due to lockdown & vaccination, market performance will improve."