The world’s most high-profile Islamist nations and terrorist organizations – from Turkish President Recep Tayyip Erdogan to the Hamas and Hezbollah groups – set aside Sunni and Shiite differences this week to unite behind Nicolás Maduro, ejected from the presidency through the invocation of a Venezuelan constitutional mandate to remove dictators.

That Muslim leaders who have previously called each other “terrorists” – Erdogan and Syrian dictator Bashar al-Assad, for example – could agree to back a Latin American despot at a moment where most of the free world has lent its support for legitimate President Juan Guaidó is a testament to decades of diplomatic work by Maduro and dictator Hugo Chávez before him to integrate the Venezuelan socialist dictatorship into the fabric of the Middle East’s anti-American regional leadership.

Guaidó took an oath of office Wednesday amid protests that he estimates attracted over 7 million Venezuelans nationwide, calling for an end to the socialist regime. Guaidó was previously president of the federal legislature, the National Assembly. Maduro has refused to step down and used the military to crack down on peaceful dissidents, killing at least 18 at press time.

Under Maduro, Hezbollah, in particular, has established itself as a force in Latin America, dominating drug trafficking routes and using senior Maduro officials such as Minister of Industries and National Production Tareck El Aissami to expand recruitment efforts into the Western Hemisphere.

Hezbollah expressed its gratitude in a statement Thursday, attacking the Trump administration for “blatant American intervention [in attempt] to destabilize Venezuela,” despite America’s lack of participation in anything happening in Venezuela this week. In this it echoed its patron, the government of Iran, which described Guaidó’s constitutional arrival at the presidency as a form of “foreign intervention” and a “coup.”

Iranian Foreign Ministry Spokesman Bahram Qassemi issued a statement in support of “Venezuela’s government and nation,” clearly referring to the socialist Maduro dictatorship, “against any kind of foreign interference in its internal affairs or any illegal act, such as attempts (to stage) a coup and anti-people measures,” according to Iran’s Tasnim News Agency.

“We hope that any political disagreement or problem in Venezuela will be resolved by the people and government of the country as soon as possible through adopting legal and peaceful solutions,” he added.

Iran’s other proxy in the region, Syrian dictator Bashar al-Assad, used his foreign ministry to extend support to Maduro, similarly framing the opposition’s rejection of Maduro’s fraudulent election in May 2018 as a secret American conspiracy.

Syrian state media quoted an unnamed “official source” at the nation’s foreign ministry as stating, “The Syrian Arab Republic condemns in the strongest terms the U.S. administration’s interference in Venezuela’s internal affairs, which is considered a blatant violation of all international laws and conventions and also an open violation of the Venezuelan state’s sovereignty.”

“The destructive policies of the US administration in different parts of the world and its disregard to international legitimacy are the main cause for the state of tension and instability in the world,” the “source” reportedly added.

With the glaring exception of Saudi Arabia, many Sunni Muslim world organizations and heads of state appeared to agree with the Iranian axis. The aforementioned Erdogan – who has attempted to maintain friendly ties with Iran while referring to Assad as a “tyrant” and repeatedly threatening to overthrow him – is perhaps Maduro’s most vocal supporter in the Muslim world.

In his first remarks since being ousted, Maduro said on Wednesday that Erdogan personally called him to extend Turkey’s support to his regime. The Turkish presidential office confirmed this, saying that Erdogan told Maduro, “Maduro brother, stand tall, Turkey stands with you.”

Erdogan went on to say that he was “shocked” that the Trump administration no longer recognized Maduro as president.

Some Palestinian leaders also backed Maduro.

“The barefaced American intervention in the affairs of countries, as is happening in the Bolivarian Republic of Venezuela, is an extension of the Trump administration’s policy of denying the will of peoples,” PLO Executive Committee member Ahmad Majdalani said on Wednesday, echoing the Iranian proxies.

Hamas also weighed in, calling the restoration of democracy in Venezuela a “coup” and once again blaming American “interventionism” for it.

“The attempt by the United States of organizing a coup d’etat in a continuation of its aggressive politics,” according to the Hamas statement, which went further than the others by accusing the United States of “violating democratic principles and the free will of peoples.”

The United States is a “threat to stability,” while Hamas expressed “gratitude” to Maduro for his consistent anti-Israel policies.

The unified language supporting Venezuela’s socialist dictator from the Middle East may be surprising to some, but it is the product of a deliberate campaign Hugo Chávez launched to make Venezuela relevant to Islamist leaders. What Chávez began with his close relationship with then-Iranian president Mahmoud Ahmadinejad, Maduro has cemented with his own overtures to Erdogan.

Defecting former chavistas and other witnesses have accused Chávez of working directly with Iran and Hezbollah. In one particularly stunning revelation – detailed in the Spanish book Boomerang Chávez – those familiar with Chávez’s foreign policy say he organized a meeting in 2007 between Chávez’s top diplomat, Nicolás Maduro, and the head of Hezbollah, Hassan Nasrallah, in Damascus. Under the auspices of Assad, according to former Venezuelan Viceminister of Finance Rafael Isea, Venezuela agreed to set in motion a scheme to issue legitimate, government-approved passports and other legal documents to members of Hezbollah born in countries like Syria and Lebanon and with no ties to Venezuela whatsoever.

Reports, including evidence from the document dump known as the “Panama Papers,” began surfacing years later that the passports were indeed issued through Venezuela’s embassies in Iraq and Syria. According to defecting officials, up to 10,000 Middle Eastern citizens with no ties to Hezbollah possess legal Venezuelan government documents.

Ahmadinejad was among the most vocal to mourn the loss of Chávez after his death in 2013, at one point stating, “no doubt Chavez will return to Earth together with Jesus and the perfect Mahdi,” the final imam that Shiite Muslims believe will arrive on earth at the end of time.

Maduro kept up much of Chávez’s Iranian network through appointing Tareck El Aissami, once the governor of Aragua state, as his vice president. El Aissami currently control’s the nation’s natural resources, recently returning from a trip to Turkey to discuss refining gold ore. Experts have described El Aissami as “one of Hezbollah’s great bagmen,” allegedly responsible for helping money from drug trafficking flow to Hezbollah’s terrorist activities and for recruiting new members in Latin America. The Iranian relationship and Venezuela’s vast natural wealth triggered the curiosity of Erdogan, who spent much of 2018 courting Maduro. Maduro was the only Latin American leader present at an emergency meeting of the Organization of Islamic Cooperation (OIC) called to condemn President Donald Trump’s decision to move the American embassy in Israel to that country’s capital, Jerusalem. He was invited to Erdogan’s inauguration last year and welcomed Erdogan for a rare head of state visit to Caracas in December.

Follow Frances Martel on Facebook and Twitter.