Turkish President Recep Tayyip Erdogan, a serial human rights violator believed to be the world’s most prolific jailer of journalists, expressed “shock” at the United States declaring Venezuelan dictator Nicolás Maduro illegitimate and offered words of support to the socialist leader Thursday.

Erdogan reportedly called Maduro on Wednesday to confirm Turkey’s support for his dictatorship after the National Assembly, the only democratic institution left in the country, swore in Juan Guaidó as the legitimate president of Venezuela. The Venezuelan constitution requires the people to reject the legitimacy of a leader who either violates human rights or disturbs the democratic order, both of which Maduro is guilty of doing.

The United States has recognized Guaidó, previously the president of the National Assembly, as the legitimate president and, as such, will disregard any authority Maduro claims to have.

Speaking at a press conference on Thursday, Erdogan said he was “shocked” that the Trump administration would not support Maduro, even though Trump made opposition to socialism in Venezuela a pillar of his 2016 presidential campaign.

“I was shocked by Trump’s attitude [to the situation in Venezuela]. It is necessary to respect the person who won the election. We are coming out against any anti-democratic actions,” Erdogan said. “If Maduro takes a tough stance … I believe the Venezuelan people will back their elected president.”

Erdogan went on to accuse those who did not “respect election results” of being “totalitarian.”

Maduro held a presidential election in May 2018 in which he blocked all non-Marxist opposition candidates. He ran against several Chavista loyalists and the Communist Party of Venezuela. The opposition, which contained some soft-socialist elements, called for a general boycott of the election as they could not participate in it. The abstention rate in the election, according to some estimates, was over 80 percent, and observers noted the use of violence and intimidation to ensure voters chose Maduro at the ballot.

Erdogan held his own rigged presidential election in June, blocking most opposition candidates from television and competing against one candidate, People’s Democratic Party (HDP) candidate Selahattin Demirtas, imprisoned for dissident statements against the regime. While not as clearly fraudulent as Maduro’s — Erdogan did allow for the secularist opposition Republican People’s Party (CHP) to run a candidate, if not nearly outright banning him from media appearances — the Turkish presidential race still elicited global condemnation for being held in an intimidating and unfair environment.

In addition to public statements Thursday, Erdogan reportedly personally called Maduro on Wednesday to offer his support. According to Turkish presidential spokesman Ibrahim Kalin, Erdogan said, “Maduro brother, stand tall, Turkey stands with you.”

Turkish state media has also begun attacking the United States, blaming Washington, DC, for Guaidó’s inauguration. The administration in Washington had merely accepted his status as president as per the constitution of Venezuela and had not previously made any moves to impose his leadership on Venezuela.

The Turkish state-run Anadolu Agency nonetheless published an infographic Thursday accusing America of “a long history of fueling coups,” including alleged support for “Alberto [sic] Pinochet” in Chile and various Middle East strongmen.

“The U.S. supported coups not only in nearby countries and regions like Central America but also in the Mideast, Europe, and Far East, causing sorrow, deaths, and underdevelopment,” Anadolu alleged.

Turkey joins Russia, Iran, Syrian dictator Bashar al-Assad, Cuba, Bolivia, the Palestinian Authority, and a small number of other totalitarian regimes in recognizing Maduro over Guaidó.

Erdogan has spent years cultivating the relationship with Maduro despite the fact that Erdogan’s Islamist Justice and Development Party (AKP) claims to be a right-wing, anti-socialist party. During the early years of his presidency, Erdogan won support by promoting free market, capitalist reforms to the Turkish economy and has continued to face opposition from much of the secularist Turkish left. Yet he has also embraced relationships with some of the world’s most prominent failed socialist governments, with Venezuela’s at the top of the list.

Erdogan invited Maduro to a meeting of the Organization of Islamic Cooperation last year and his inauguration last July. The relationship appeared to culminate this month with Venezuela agreeing to allow Turkey to refine thousands of tons of gold ore from the South American country, which is a lucrative business for Turkey.

Erdogan promised last month that Turkey would “cover [Venezuela’s] necessities” economically in exchange for access to its natural resources, including providing funding to develop a large mosque in Caracas, despite a negligible Muslim population in the majority-Catholic country.

Follow Frances Martel on Facebook and Twitter.