SAO PAULO, March 30 (Reuters) - Brazil's Revenue Service on Thursday mandated electronic invoices for gold trade when bullion is declared as a financial asset or foreign exchange instrument, a rule aimed at curbing illegal wildcat mining.

The measure, effective July 3, comes as the new government doubles down on efforts to combat the humanitarian crisis of the Yanomami people caused by illegal mining in their territory. It would also restore the enforcement of environmental protection relaxed by the former government.

The measure is set to allow trade operations using gold to be audited using technological tools.

"This is a very important step to avoid the financial promotion of illegal gold mining activities in regions such as the Amazon," said Raul Jungmann, director-president of the Brazilian Mining Institute (Ibram), in a statement.

The illegal gold extraction is at the base of a series of criminal actions that also affect the country's mining sector with "unfair competition," he noted.

Brazil registered 52.8 tonnes of gold with serious indications of illegality in 2021, data from non-governmental organization Instituto Escolhas showed. The amount represents 54% of national production. Around 20% of Brazilian gold had no declared origin in that year, Ibram said, citing National Mining Agency data.

More actions need to be taken, said Ibram, which represents gold miners like AngloGold Ashanti and Yamana Gold , and other large miners like Vale, Rio Tinto and BHP.

"Eradicating illegal mining requires, in addition to repressing and expelling the individuals and organizations involved in this criminal practice, preventing access to the internal and external gold markets and making middle-men and buyers criminally responsible," Ibram said. (Reporting by Roberto Samora; Additional reporting by Marcela Ayres; Writing by Carolina Pulice; Editing by Richard Chang)