SAO PAULO, Sept 25 (Reuters) - Foreign investors are pumping more money into Brazil's financial sector while turning away from mining and steel companies, a study by stock exchange operator B3 and analytics firm Neoway showed on Monday.

Among 11 sectors surveyed, basic materials was the only one to post a negative net balance of foreign investments in 2022 and so far this year. This includes miners, steelmakers, pulpmakers, paper firms and petrochemical producers. Analysts cited a slump in iron ore prices and a slowdown in China, the world's second largest economy and a big customer for raw materials from Brazil.

International investors have a huge influence on fluctuations in Brazil's equities market, as they represent more than half of the annual trading volume on the South American country's stock exchange.

According to the study, basic materials became stock sellers' focus in the last year-and-a-half, recording a negative balance of 5.5 billion reais ($1.11 billion) last year and 13.7 billion in 2023 by the end of June.

That movement reversed a positive trend for investment in those companies in 2020 and 2021. In 2020, basic materials and oil, gas and biofuels were the only sectors with positive inflows. In 2021, it was basic materials and information technology.

"It's China and iron ore," XP Investimentos analyst Lucas Laghi said when asked about the reasons for the new trend.

Iron ore prices jumped between 2019 and 2020, but lost steam in mid-2021 and have remained range-bound since then, affected by conflicting factors such as China's economic recovery and the weakness of that country's real estate sector.

These have a major impact on Brazil's stock market, as firms such as mining giant Vale account for nearly 15% of Brazil's benchmark stock index Bovespa.

Foreign investors have moved more money into Brazil's financial stocks, a sector that includes banks, shopping mall operators and insurance companies.

After recording the largest negative balance among all sectors between 2019 and 2021, financials had the second-largest net inflow last year, with 20.8 billion reais, lagging only oil, gas and biofuels, which amassed 22.5 billion reais.

In the first half of 2023, financials reached the highest net balance, totaling 11.3 billion reais in the period.

Across the whole stock market, Neoway's study showed, foreign investment balance hit a negative 39.2 billion reais in 2020 before narrowing the loss in 2021 and turning positive last year.

The first six months of 2023 saw a positive balance of 17.3 billion reais.

($1 = 4.9700 reais) (Reporting by Andre Romani; Additional reporting by Patricia Vilas Boas; Writing by Gabriel Araujo; Editing by David Gregorio)