Information technology stocks lifted Indian benchmark indexes on Friday as an improvement in economic growth in the U.S., a key market for the sector, boosted sentiment.
Both the benchmarks added 1.24% and 0.9% for the week, posting eighth week of gains.
The NSE Nifty 50 rose 1.76% to 24,834.85, while the S&P BSE Sensex gained 1.62% to 81,332.72, logging their best session in seven weeks.
The Nifty also hit a record high in the final minute of the trading session.
Both Nifty and Sensex had logged losses for the last five sessions, weighed down by weaker-than-expected results from Reliance Industries, Wipro, Bajaj Finance, Axis Bank and Nestle.
The union budget on Tuesday, in which tax hikes on capital gains in equity investments and derivatives trading were announced, also had a negative, but short-term impact on the market, analysts said.
All the 13 major sectors advanced, on the day.
Information technology stocks rose 2.3%, after data showed that the U.S. economy grew faster than expected in the second quarter.
Improving growth outlook in the U.S. helps Indian IT companies, which earn a significant share of their revenue from the country.
Investors await the U.S. personal consumption expenditures data - the Federal Reserve's preferred gauge of inflation - due after the closing bell, to confirm bets of a rate cut in September.
"Most IT companies have indicated green shoots in discretionary spends and large verticals like banking and financial services, which is also aiding investor interest in the sector," said Meeta Shetty, fund manager at Tata Asset Management.
Metal index gained 3%. It had shed 1.3% in the previous session on demand concerns in top consumer China.
Drug maker Cipla gained 5%, powering pharma index 2.3% higher, after posting first-quarter profit above expectations, aided by higher sales.
The broader, more domestically focussed small- and mid-caps rose 1% and 1.8%, on the day.