RIO DE JANEIRO — This was the year things were supposed to change between Brazil and the United States. Years of leftist rule in Brazil were over. Jair Bolsonaro, an avowed fan of President Trump and the United States, was now president. And he was promising a dramatic reorientation in Brazil’s foreign policy, away from its cast of socialist alliances and toward the United States.

The “Trump of the Tropics,” people called him.

But rather than lead to a new beginning between the largest countries in the Americas, the rapprochement has led instead to false starts, unfulfilled expectations and ignominious tweets.

On Monday, the diplomatic skid accelerated when Trump tweeted he was reinstating tariffs on steel and aluminum from Brazil and neighboring Argentina. He said the South American nations had artificially devalued their currencies to make their industries more competitive against the United States.

The early-morning tweet stunned Bolsonaro, who appeared completely caught off guard in his comments to reporters outside the presidential palace.

“I’m going to speak with Paulo Guedes,” he said, referring to the country’s finance minister. “Aluminum? I’m going to speak with Paulo Guedes now. . . . If necessary, I’ll call Trump. I have an open channel with him.”

That Bolsonaro, who has repeatedly praised Trump and sought to install his son as U.S. ambassador, had no warning of Trump’s decision further underscored what for some time has been clear: His gambit to push Latin America’s largest country closer to the Trump administration is looking increasingly like a humiliating diplomatic defeat.

Over and over in recent months, Bolsonaro has been surprised and stung by Trump’s slights and about-faces.

Trump told Bolsonaro this year he would back Brazil’s bid to join the Organization for Economic Cooperation and Development — a promise Bolsonaro then touted as a political achievement. But then the U.S. recommendation letter leaked, showing that the Trump administration was supporting Romania and Argentina for membership, not Brazil.

A few weeks later, the U.S. government refused Bolsonaro’s request to lift its ban on Brazilian imports of beef over safety concerns — again taking his administration by surprise.

Now Trump is targeting one of the most important industries in Brazil, at a time when unemployment is above 10 percent and the economy has stalled.

“There have been no major concessions from the United States and not even meaningful gestures of support for Bolsonaro,” said Maurício Santoro, a political scientist at the State University of Rio de Janeiro. “Trump did not even defend the Brazilian president when he was criticized in demonstrations in New York.

“Bolsonaro’s ‘America First’ foreign policy,” he said, has so far produced only a “lack of results.”

Trump predicted in March that he and Bolsonaro would have a “fantastic working relationship.” Bolsonaro called Trump “an example for me,” and said they would work together “toward the benefit of our two nations.”

Now the collapse of what had once seemed a promising union between the two largest economies in the Americas has opened the door for China to accelerate its push into Latin America.

Bolsonaro has frequently criticized Brazil’s entanglements with China, the country’s largest trading partner. As a candidate, he traveled to Taiwan and announced he would end a foreign policy he derided as unacceptably “friendly with communist regimes.”

But it has been China — not the United States — that has repeatedly come to his aid when he needed help.

Last summer, as the Amazon rainforest burned and countries started threatening to ban Brazilian exports of beef — its production has accelerated deforestation — China announced it would buy more. Then last month, in a giant oil auction Brazilian officials had touted as historic, China helped stave off another embarrassment: All international bidders stayed away — except for the Chinese.

“As things stand, the Chinese are winning this geopolitical standoff that’s taking place between Washington and Beijing in Latin America,” said Oliver Stuenkel, a professor of international relations at the Getulio Vargas Foundation in São Paulo.

He said the rupture of the relationship between the Brazilian and U.S. governments was, in a way, predictable. Trump’s political interests are in conflict with Brazil’s economic ambitions. The Brazilian economy is based on producing and selling commodities — the same products provided by Trump’s political base in the manufacturing and farming communities.

“All you’re left with are words and promises, but, structurally, this closer relationship doesn’t produce mutual benefits,” Stuenkel said. “As a consequence, it’s fairly obvious that, having started with great expectations, this would somehow end in frustration.”

This moment and this tweet could be more harmful to the relationship than past snubs by Washington. This one was much more public. Trump lashed out — in front of 67 million Twitter followers — at a political ally who had invested significant political capital into trying to win him over.

“Trump’s tweet was definitely humiliating for Bolsonaro,” said Guilherme Casarões, a political scientist at the Getulio Vargas Foundation. “Unlike previous moments when the U.S. snubbed Brazil, Bolsonaro and his closest aides cannot blame the opposition for distorting facts or manipulating the truth.”

It could make Bolsonaro more likely to go against Washington’s wishes. The Trump administration has tried to steer Brazil away from the Chinese telecommunications conglomerate Huawei in its bid to bring a 5G mobile network to Brazil. But Bolsonaro has been meeting with Huawei officials and seems poised to go forward with the Chinese company — despite Washington’s protests that it’s only a veil for Chinese surveillance.

“Unlike Trump, [Chinese President] Xi Jinping sees Brazil as a key Chinese ally in Latin America and as a strategic partner in the trade war with Washington,” Casarões said. “It seems likely that Brazil will favor China in the dispute.”