BENGALURU - Indian shares ended at a three-week high on Friday, logging their first weekly climb in three, led by strong buying in technology stocks.

The NSE Nifty 50 index closed 0.19% higher at 17,833.35, while the S&P BSE Sensex rose 0.18% to 59,793.4, after climbing 0.7% each, earlier in the session.

For the week, both indexes gained around 1.7%, driven by gains in tech and banking stocks.

Markets are now eyeing data due Monday which is likely to show retail inflation snapped a three-month downward trend in August as food prices surged, according to a Reuters poll of economists.

Foreign investors are piling money into the market once again on expectations that growth for the Indian economy will be better compared to global peers, although analysts have cautioned about expensive valuations.

For the year, the Nifty 50 is up around 2.8%, while MSCI's broadest index of Asia-Pacific shares outside Japan has declined 19.7% and the S&P 500 Index dropped around 16%.

A slide in oil prices, amid worries of central banks' aggressive rate hikes and China's COVID-19 curbs, lifted investor sentiment. India, the world's third-largest importer of oil, benefits from a fall in prices as it brings down imported inflation.

The Nifty IT index added 2.2% to its best closing level in over two weeks, and was the best performing sub-index on Friday, with heavyweight Infosys climbing 2.4%.

Rice producers, however, slid after India banned exports of broken rice and imposed a 20% duty on overseas sale of some grades, as the world's biggest exporter of the grain sought to augment supplies and calm local prices.

Rain Industries closed 7.7% down on its worst day since June 20, after the carbon and advanced materials maker said a European unit would temporarily shut in anticipation of potential natural gas shortages and price spikes.

(Reporting by Chris Thomas in Bengaluru; additional reporting by Gaurav Dogra)