Brazil will not get involved in a trade war, President Jair Bolsonaro said Thursday, after US-foes China and Russia criticized growing protectionism as the global economy slows.

Bolsonaro, who has been walking a diplomatic tightrope at the BRICS summit in Brazil this week as he seeks to strengthen ties with China without upsetting key ally Donald Trump, said Brazil "trades with the entire world."

"I won't enter into this trade war," he told local media outside his residence in the Brazilian capital.

"We want the best for our people through this kind of relationship."

Bolsonaro's remarks come after Chinese President Xi Jinping and Russian leader Vladimir Putin used a business forum on the sidelines of the BRICS get-together to attack unfair trade practices, in remarks apparently directed at the United States.

Beijing is involved in a protracted trade war with Washington that has roiled the global economy.

"Mounting protectionism and bullyism have eroded international trade and investment and are weighing down the world economy," Xi told business leaders on Wednesday.

Putin said "protectionism was thriving" amid the use of "unilateral sanctions."

Indian Prime Minister Narendra Modi and South African President Cyril Ramaphosa are also attending the two-day BRICS meeting, which is focused on economic growth and innovation.

China's President Xi Jinping (L) and Brazil's President Jair Bolsonaro (R) wave before a bilateral meeting in Brasilia ahead of a summit of the BRICS countries
China's President Xi Jinping (L) and Brazil's President Jair Bolsonaro (R) wave before a bilateral meeting in Brasilia ahead of a summit of the BRICS countries AFP / Sergio LIMA

While no major announcements are expected in the BRICS joint declaration to be issued later Thursday, the meeting has given Bolsonaro the chance to deepen ties with Xi -- a relationship that only months ago looked to be in jeopardy.

Signalling a pragmatic approach to Brazil's biggest trade partner, Bolsonaro said Wednesday that China was becoming "more and more" part of the Latin American country's future.

"We are talking to China about the possibility of a free trade area," Economy Minister Paulo Guedes told a forum on the sidelines of the summit, Brazil's state news agency reported.

"Our policy from the beginning was very clear, we are seeking higher grounds of integration."

Bolsonaro -- an ardent admirer of Trump with whom he shares a contempt for multilateralism and left-wing ideology -- has been under pressure from Brazil's powerful beef, farming and mining sectors to stay on good terms with China.

He had threatened to torpedo the relationship during last year's election campaign when he accused China of "buying Brazil," and his pro-business government has been trying to repair the damage ever since.

The BRICS summit is the first time Bolsonaro has hosted a major international gathering since he took office in January.

While the event itself has been free of incidents, Russian punk protest group Pussy Riot performed at a concert Wednesday night a few kilometers from where Putin and other leaders were staying.

"Out, Bolsonaro! Out, Putin!" the band shouted during the performance attended by several hundred music fans.