President Donald Trump and Brazilian President-elect have both offered seemingly unnecessary salutes to foreign officials.

Trump and Bolsonaro have drawn comparisons for their incendiary rhetoric and political style.

Bolsonaro, a former army officer, has expressed affinity for Trump and support for more hardline security policies.

President Donald Trump and Brazilian President-elect Jair Bolsonaro have drawn comparisons for their inflammatory rhetoric and reputations as outsiders — Bolsonaro, a far-right nationalist, has been called "Trump of the Tropics."

On Thursday, Bolsonaro added another point of comparison with his US counterpart.

At his home in Rio de Janeiro, Bolsonaro offered visiting US National Security Advisor John Bolton a crisp salute before leading him to an open-air meeting room and offering Bolton coffee and refreshments, as Bolton exchanged greetings with Bolsonaro's advisers.

Bolsonaro, who takes office on January 1 and has said he wants to align his policies with those of the Trump administration, said afterward that he accepted an offer to visit the US made by Bolton on Trump's behalf.

Bolton, who has called Bolsonaro "like-minded," said afterward he "Enjoyed a wide-ranging, very productive discussion" with Bolsonaro and his national-security team and that he "look[ed] forward to a dynamic partnership."

Read more: Brazil's new president has been called the 'Trump of the Tropics,' but the White House says there's only one Trump

Bolsonaro was also mocked for his somewhat awkward greeting, which was reminiscent of an interaction between Trump and a North Korean general at a summit in Singapore in June.

In that encounter, featured in a documentary produced by North Korean state media, Trump makes his way down a row of North Korean officials shaking hands before reaching the country's defense chief, Gen. No Kwang Chol, who offered Trump a salute as the US president stuck out his hand.

The two then reversed their gestures, with Trump returning a salute, as North Korean leader Kim Jong Un looked on.

A still from a video released by North Korea showing President Donald Trump returning a salute from a North Korean general. Jason K. Morrell/Twitter

Trump was disparaged for the gesture, with critics citing the cruelty of the North Korean regime as well as the fact that the US and North Korea are technically still at war, as the Korean War between 1950 and 1953 ended with an armistice. (North and South Korea have been working to reduce tensions in recent months.)

White House Press Secretary Sarah Huckabee Sanders defended her boss, saying it was "a common courtesy when a military official from another government salutes, that you return that."

Military members are required to salute the US president in recognition of his status at the top of their chain of command, but there is no regulation that requires the president to return the salute. This tradition dates to President Ronald Reagan, and which President Trump has since expanded to include members of foreign militaries — even US adversaries.

Bolsonaro, who retired as an officer after 17 years in Brazilian army, has expressed support for giving the military a broader role in civil society — a stance that has raised concern about rights abuses and the erosion of the rule of law.

Brazilian President-elect Jair Bolsonaro, left, with US national-security adviser John Bolton, in Rio de Janeiro, November 28, 2018. John Bolton/Twitter

After a successful presidential campaign in which former military leaders had an active role — including a running mate who retired as a four-star general in February — Bolsonaro appears to be stocking his Cabinet with former military leaders.

On Tuesday, he said he would appoint Tarcisio Freitas, a longtime military engineer, as head of the infrastructure ministry. Freitas was the sixth minister selected who has a military background.

Read more: During a visit to Brazil, Mattis gave a blunt warning about generals getting involved in politics

Bolsonaro has said he wants former Brazilian Gen. Augusto Heleno to be his top national security adviser. Heleno commanded UN peacekeepers in Haiti, where in 2005 he led raid that ended in a deadly seven-hour gun battle.

Other military officials tapped for the Cabinet have connections to Haiti.

Brazilian soldiers frisk residents during an operation against drug dealers in Cidade de Deus slum in Rio de Janeiro, February 7, 2018. REUTERS/Ricardo Moraes

Former Gen. Fernando Azevado e Silva, picked to be defense minister, served there as Heleno's operations chief. Freitas was the senior UN military engineer there, arriving after Heleno left in 2005.

Retired Gen. Carlos Alberto Dos Santos Cruz, named as the next government minister, also led UN peacekeepers in Haiti in 2007.

Read more: Here are the mysterious origins of the modern military salute

Troops have already been deployed in Brazil to address rampant crime and insecurity. Connections to Haiti among Bolsonaro's advisers add to concerns about his expressed support for militarized law enforcement.

"We are at war. Haiti was also at war," Bolsonaro said in a recent interview, according to Reuters. In Haiti, he added, "the rule was, you found an element with a firearm, you shoot, and then you see what happened. You solve the problem."