IT BEGAN three months ago with a protest against cuts in pensions decreed by Daniel Ortega, Nicaragua’s president. Now his Central American country is witnessing a full-blown civil insurrection with mass casualties. Although it has received far less attention, Nicaragua is following the script of Venezuela, in which an elected dictator clings to power though repression and at the cost of economic destruction. And as in Venezuela, restoring peace and democracy is a task for which outsiders seem to lack both the will and the tools.

Some 300 people have been killed since April in a country of 6.2m according to human-rights groups, almost all of them unarmed protesters at the hands of paramilitary thugs acting in cahoots with Mr Ortega’s police. Among the latest victims were at least 20 killed on July 8th when the paramilitaries cleared opposition barricades from two small towns south of Managua, the capital.

That conforms to the pattern of this unequal struggle. Students and other young people in the broad opposition movement have thrown up improvised barricades across the country, initially as a means of protest and now in self-defence against the paramilitaries. This month Mr Ortega began a drive to remove them. “He has retaken territory through terror,” says Edmundo Jarquín, an opposition leader. “But to think he can return to authoritarian stability and economic growth is impossible.”

The irony in all this is that Mr Ortega was a leader of the left-wing Sandinista revolution which in 1979 toppled the cruel dynastic dictatorship of Anastasio Somoza. Many of his opponents now are former comrades. And Mr Ortega is aping the repression of the Somozas.

Having been defeated in an election in 1990, Mr Ortega was voted back into office in 2006. Through an unholy alliance with a corrupt former president of the right and by packing the supreme court, he overturned the constitution’s term limits. In the mould of contemporary strongmen worldwide, he has kept the outward trappings of democracy while gutting its content. He was elected for a third consecutive term in 2016 by the expedient of banning the main opposition candidate.

Mr Ortega and his wife, Rosario Murillo, who rule as a couple, seemed to have hit on a successful formula. They allied with the private sector and the Catholic church, and avoided fights with the United States, while using Venezuelan aid for social projects which kept poorer Nicaraguans quiescent. But then Venezuela cut its aid, and the government’s fiscal problems were exacerbated by corruption.

To try to calm the protests, Mr Ortega beat a tactical retreat. He withdrew the pension cut, agreed to talks brokered by the church and invited the Inter-American Commission on Human Rights to investigate the violence. The church, the business association and the United States proposed a plan under which the general election due in 2021 would be brought forward to next March.

Now Mr Ortega has gone on the offensive again. His officials claim, in a further echo of Venezuela, that he is the victim of an attempted “coup” against the constitution (which he himself has perverted). They insist, against the evidence, that the violence comes from both sides and say that the government will not negotiate while the barricades remain. Mr Ortega now says he plans to stay until 2021.

Just as in Venezuela, the government appears to be using talks to play for time, and to try to divide the opposition. Yet so far Mr Ortega’s actions seem to have unified it. This week his paramilitaries roughed up two bishops when they went to the aid of opponents of the government who were sheltering in a church. The private sector plans a second one-day general shut-down on July 13th.

There are some contrasts with Venezuela. Mr Ortega has no oil and his economy is more vulnerable (it will shrink by 6% this year, according to a private-sector forecast). He may be more susceptible to pressure from the United States, which this month imposed sanctions against three Nicaraguan officials. The critical factor is the army. Although Mr Ortega brought it under his formal control, it is more independent than its Venezuelan counterpart and is not colonised by Cuban spies. There are calls for it to intervene to disarm Mr Ortega’s death squads, but so far it has remained above the fray.

The next few weeks will be crucial. Venezuela shows that a regime which is heedless of the human cost can survive sustained national protests and international pressure. Nicaraguans can only hope that their country will indeed prove to be different.