MANY PEOPLE outside Latin America probably assume Daniel Ortega's political career ended 15 years ago when his ruinous attempt to install a Marxist dictatorship in Nicaragua ended with an election he decisively lost. The slightly better informed might suppose that his two subsequent electoral defeats, the allegations of corruption and child molestation that haunt him, or his single-digit rating in opinion polls have made him a marginal figure in Nicaraguan politics. Sadly, the truth is otherwise: Thanks to the weakness of the country's new democratic institutions, Mr. Ortega is close to regaining power and to broadening the Latin alliance of undemocratic states now composed by Cuba and Venezuela.

Mr. Ortega's comeback has been accomplished through a brazenly corrupt alliance with a former right-wing president, Arnoldo Aleman, who was sentenced to 20 years in prison in 2003 for looting the national treasury. Mr. Ortega's Sandinista Party supported the prosecution, then abruptly switched sides and formed a pact with Mr. Aleman against President Enrique Bolanos, a member of Mr. Aleman's Liberal Party who bravely chose to tackle government corruption. The left-right alliance has used its majority in the National Assembly to rewrite the constitution and stack the Supreme Court. In the past week it has begun stripping the members of Mr. Bolanos's cabinet of immunity so that they can be prosecuted before Sandinista judges on bogus charges. If this power play succeeds, Mr. Bolanos will be next. Meanwhile, Mr. Aleman, who stole tens of millions from one of Latin America's poorest countries, was freed from house arrest last week.

Mr. Ortega's goal is to force Mr. Bolanos to accept his constitutional rewrite, which transfers almost all presidential powers to Congress. That would effectively deliver Nicaragua to Sandinista control without one of the elections that Mr. Ortega keeps losing. Scheduled elections next year could then be manipulated. Already, the corrupt alliance has lowered the percentage of the vote a presidential candidate needs to be elected to 35, and criminal charges have been brought against one of the leading candidates. The Sandinistas will have plenty of money to spend, thanks to Hugo Chavez. Mr. Ortega recently announced that he had arranged with Venezuela's self-styled "Bolivarian revolutionary" for a supply of subsidized oil.

Compared with Mr. Chavez's aggressive intervention, attempts by the Bush administration and other outsiders to save Nicaraguan democracy so far look feckless. The new secretary general of the Organization of American States, Jose Miguel Insulza, tried to broker a political compromise but pronounced himself frustrated when Mr. Ortega ignored his appeals to stop undermining Mr. Bolanos's government. The Bush administration managed to win congressional passage of the Central American Free Trade Agreement this summer, but Mr. Ortega has blocked its ratification by Nicaragua.

Deputy Secretary of State Robert B. Zoellick is due to visit Managua this week in what officials say will be an attempt to bolster Mr. Bolanos and persuade Mr. Aleman's right-wing supporters to abandon their self-destructive alli- ance with the Sandinistas. As happens so often in Latin America during the Bush administration, high-level intervention arrives late. It does have one thing going for it: Eighty percent of Nicaraguans say they oppose the Ortega-Aleman pact. Nicaragua's rescue will depend on people power, inside or outside the polls.