India's benchmark indexes bucked the global weakness to end higher on Friday, boosted by HDFC Bank, although the gains were not enough to prevent their first weekly loss in five on worries over the Middle East conflict and U.S. rates.

The Nifty 50 rose 0.69% to 22,147, while the S&P BSE Sensex added 0.83% to 73,088.33, gaining for the first time this week. But they lost about 1.6% over the holiday-shortened week.

HDFC Bank, which has the highest weight on the Nifty, rose 2.45%, and helped lift financial services 1.31%, ahead of reporting its quarterly results on Saturday.

U.S.-rate sensitive IT stocks lost 0.39% on the day and 4.71% over the week, their second worst week in 12 months, on fading hopes of early U.S. rate cuts and disappointing reports from market leaders TCS and Infosys.

The duo, along with Wipro, which reported a bigger-than-expected quarterly revenue moments after the closing bell, and HCLTech have lost between 3.8% and 5% this week, among the most on the Nifty 50. The escalating tensions between Israel and Iran weighed on stock markets globally and sent oil prices surging, sparking concerns of rekindling inflation, especially in net importers of the commodity, like India.

"Worries of higher-for-longer U.S. interest rates have now coupled with fears of higher-for-longer oil prices, bringing inflation concerns back to the fore, hurting investor sentiment," said Saurabh Jain, assistant vice president of research of retail equities at SMC Global Securities.

The broader, more domestically focussed small- and mid-caps lost 1.37% and 2.74%, respectively, this week.

Volatility jumped to a one-month high on Friday.

It will remain elevated, especially with weak IT results, the national elections, which started on Friday, and weak global cues keeping investors nervous, Jain said.

(Reporting by Bharath Rajeswaran in Bengaluru; Editing by Eileen Soreng, Sonia Cheema and Savio D'Souza)