Rio de Janeiro (AFP) - Brazil's President Jair Bolsonaro will walk a diplomatic tightrope Wednesday when he hosts his Chinese counterpart, as he seeks to boost ties with Beijing and avoid upsetting key ally Donald Trump.

Just weeks after his first official visit to China, Bolsonaro will hold talks with Xi Jinping in Brazil's capital Brasilia on the eve of a summit with their BRICS counterparts from Russia, India and South Africa.

Bolsonaro's bilateral meeting with Xi -- one of several to be held on the sidelines of the annual BRICS get-together that will focus on economic growth and innovation -- comes as the United States and China wage a protracted trade war that has roiled the global economy.

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, the Latin American country's biggest trade partner.

Bolsonaro 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 will be the first time Bolsonaro, notoriously awkward at public events, has hosted a major international gathering since he took office in January.

It could provide cover for him to talk to Xi without appearing disloyal to Trump, said Luis Fernandes of the BRICS Policy Center in Rio de Janeiro.

"There's a strong allegiance with the Trump administration, but he wants to keep channels of economic cooperation, trade and investment open with China," Fernandes told AFP.

"He has to play within these tensions. China is very pragmatic in its foreign policy -- I think China can play that game."

Bolsonaro sent a positive signal during his visit to Beijing last month when he declared Communist-ruled China "a capitalist country."

Brazil and China's mutual dependency will ensure pragmatism prevails in the relationship, said Oliver Stuenkel, a professor of international relations at the Getulio Vargas Foundation.

Story continues

"Brazil's future depends much more on China than on the United States," Stuenkel told AFP.

And "the Chinese know they will depend on Brazil not only tomorrow or in five years, but also in 50 years from now because they can't feed themselves. This is a long-term strategic relationship for China."

Brazil is China's biggest source of soy imports.

- BRICS still relevant? -

Huge disparities in the economic might of BRICS members and their deep differences on issues ranging from climate change to the Venezuelan crisis have raised questions about the relevance of the group, which began in 2001 when a Goldman Sachs economist coined the BRIC acronym.

S&P Global Ratings said last month the grouping "may no longer make sense."

"The diverging long-term economic trajectory of the five countries weakens the analytical value of viewing the BRICS as a coherent economic grouping," S&P said in a report.

Russian President Vladimir Putin, Indian Prime Minister Narendra Modi and South African President Cyril Ramaphosa have confirmed they will attend.

Stuenkel said BRICS still served an important purpose for Beijing and Moscow.

"China thinks of it as a pillar in a more China-centric order. For the Russians, it's just extremely useful to show they're not isolated," he said.

Bolsonaro has broken with tradition at this year's summit by scrapping the BRICS Plus meeting that enables the five members to meet with the host's neighboring countries.

It follows what Stuenkel said was a disagreement over whether to invite Venezuelan President Nicolas Maduro or opposition leader Juan Guaido, widely recognized as the crisis-hit country's interim president.

Brazil is the only BRICS member to support Guaido.

The decision shows Bolsonaro "has no ambition whatsoever to lead the region," Stuenkel said.

No major announcements are expected from the summit on Thursday, mainly owing to the Brazilian government's "low enthusiasm" for the gathering, Control Risks consultancy said.

Nor is the meeting likely to discuss protest movements raging around the world, including Chile, which was forced to cancel the APEC meeting that had been scheduled to start November 16.

"It's something China doesn't like to open up about," Stuenkel said.

Despite Bolsonaro's misgivings about BRICS, it could become more important for Brazil if a Democrat were to win the US presidential election next year.

That would leave Brazil further isolated following Bolsonaro's diplomatic spats with European powers and left-wing Latin American governments -- a risk not lost on his technocrats, said Stuenkel.

"They're very happy to be part of BRICS," Stuenkel said.

"Even if Brazil becomes some sort of pariah in international affairs in the next couple of years, it will always have BRICS."