Almost 40 years ago, US-backed dictator Anastasio Somoza Debayle was overthrown by Cuban-funded Sandinista rebels in the Nicaraguan revolution. After a devastating earthquake and the resulting humanitarian crisis, Jimmy Carter withdrew his support and denied the fleeing Somoza refuge.

In the 1980s, the Sandinistas eventually prevailed over US-sponsored Contras counter-revolutionaries. Daniel Ortega became president of Nicaragua, taking his place in the annals of history alongside Cuba’s Fidel Castro and Venezuela’s Hugo Chavez as a Latino revolutionary: a hero of the poor and oppressed.

And now? Castro and Chavez dead; Cuba (a vital historical ally) much diminished, and Venezuela (the region’s success story) all but destroyed. And Ortega? Murdering his own people in the streets.

Nicaragua has quietly become the next Latin American crisis zone – and, once again, a battleground for US foreign policy.

Just this week, the UN’s human rights office published a damning report into the human rights abuses that have taken place since the Nicaraguan protests began in April earlier this year. At least 300 dead and 2,000 injured, hundreds facing trumped-up charges, enforced disappearances, illegal detentions, torture and sexual violence, as well as a violent crackdown on the independent press.

There’s no love lost between the two countries - at odds over border disputes, amongst other issues – but President Carlos Alvarado has made clear that Costa Rica will not change its position with regards to the safety of immigrants.

Indeed, if any country turned over the names of political asylum candidates to the government they were fleeing, it would be an astonishing violation of privacy and the right to security, not to mention a reckless endangerment of the families they left behind.

Wouldn’t it? For Trump’s America, perhaps not.

Last November, the Trump administration decreed that the temporary protected status (TPS) of almost half a million immigrants would be coming to an end, forcing them to either leave or remain in the US illegally.

This decision affects hundreds of thousands from Central America, particularly El Salvador and Honduras, but also includes roughly 2,500 Nicaraguans – with the shortest deadline. They have until January to leave.

Every country fought to get their TPS extended, except Nicaragua. Ortega didn’t issue an explanation, but we can assume he didn’t much care for the Nicaraguans in the US, many of whom fled during the Contra war and remain politically anti-Sandinista.

The US embassy and state department officials recommended that the TPS be extended, but Trump ignored them. This summer, the White House condemned the Ortega regime for human rights abuses and violence against its own people, even designating three Nicaraguan officials under the Global Magnitsky Act. Seven members of Congress wrote to Trump to ask for either an extension of TPS, or a new status for Nicaraguans.

So, on the one hand, there is condemnation, sanctions and promises of aid; on the other, a commitment to send thousands of dissenters back to almost certain reprisal; to a place from which the US rescued its own embassy staff.

On the one hand, pressure from the Democrats (some historically sympathetic to the Sandinista regime); on the other, pressure from Trump’s own Conservative base in Florida, close to the exiled anti-Sandinista community, and some of his supporters in Congress - like Senator Rubio, who vocally warned of a potential civil war.

Like almost all foreign policy issues, Trump’s administration is inconsistent at best on Nicaragua; inhumane at worst.

Neighbouring Honduras set up a similar organisation in 2016, in response to protests following the discovery that huge sums of money in social security-funded healthcare had been embezzled, ending up in the coffers of the campaign.

President Juan Orlando Hernandez was sworn in for a second term this January, after a violent crackdown on those who protested the vote resulted in at least 31 deaths and hundreds of arrests. He’s been trying to limit the mandate of the anti-corruption organisation ever since. Its leader resigned in February, citing lack of support.

Morales’s move, emboldened by Ortega, is not only a huge blow to the fight against corruption in the country, but to democracy in the region as a whole – and will undoubtedly embolden Hernandez.

The geographical proximity, as well as the potential influx of refugees, will eventually force Trump’s hand in Central America. But he might well meet his match there.

Before Morales was president, he was Guatemala’s most famous slapstick comedian whom few took seriously. He achieved a surprise victory on the back of crudeness, subversion and a notable lack of policy. The CICIG is also investigating whether Morales’s presidential campaign received illegal funding, while Morales claims bias and tries to expel the UN commission’s chief. Sound familiar?

Recently, Ortega gave a confrontational interview to Fox News, denying well-documented facts and claiming political conspiracy, accusing detractors of "lies, terrible lies". Familiar?