highs on Tuesday, bolstered by continued buying from foreign investors, with net purchases of $117.87 million on Thursday, their 23rd buying session in the previous 24.
Still, some of the momentum has waned. The NSE index ended the week down 0.2 percent, its second consecutive week of falls, and 1.2 percent away from its record high of 6,574.94 hit on Tuesday.
Profit-taking after a strong rally, and some global factors, including a bout of selling tied to concerns that the Federal Reserve would raise interest rates earlier than expected, have pressured shares.
"We are cautiously optimistic in the near term. The undercurrent is positive, but profit-taking is expected in select sectors and stocks. We will continue to see sectoral rotations-like that we saw in IT," said Deven Choksey, managing director at KR Choksey Securities.
"We may see fresh positions building up after the monthly derivatives contract expiry, in the coming week."
The benchmark BSE index closed 0.06 percent higher at 21,753.75. It lost 0.26 percent this week.
The broader NSE index closed 0.16 percent higher at 6,493.2.
Relative underperformers in the recent rally continued to gain, with Tata Motors Ltd up 2.5 percent after falling 8.9 percent this month as of Thursday's close.
Meanwhile, Tata Consultancy Services Ltd rose 0.9 percent, after being hit earlier this week after saying revenue growth could slow this quarter from the previous quarter. Shares had fallen 7.4 percent this month as of Thursday.
Axis Bank Ltd rose 2.7 percent on speculation that its weightage in FTSE indexes is due to increase when the index provider rejigs the composition of its benchmarks after the close of markets on Friday.
The speculation on FTSE offset pressure earlier in the day, when Axis Bank shares fell as much as 2.6 percent, as the government raised more than $900 million by selling a 9 percent stake in the bank.
However, shares speculated to be losing some weightage in FTSE indexes fell. Reliance Industries Ltd fell 2.2 percent.
Oil and Natural Gas Corp fell 2.98 percent, with some profit-taking hitting the stock after gaining 8.4 percent this month as of Thursday's close.
Blue chips broadly recovered from Thursday's fall, with State Bank of India up 1.44 percent after losing 1.81 percent in the previous session.