THE ELECTION of Mauricio Funes as president of El Salvador in 2009 set up a test of whether the leftist Farabundo Marti National Liberation Front (FMLN), which had tried and failed to take power by force during a 1980s civil war, could govern the country democratically. Mr. Funes has mostly met the test; but since losing parliamentary elections to the rival ARENA party in March, his party has appeared to embrace the tactics that brought other leftist strongmen to power in the region.

After critiquing Mr. Funes for failing to lead El Salvador into the regional alliance created by Venezuela’s Hugo Chavez, his hardline vice president, a former civil war commander named Salvador Sanchez Ceren, was chosen as the party’s 2014 presidential candidate. Now the FMLN has forged an alliance with splinter parties in the National Assembly and launched a power struggle with the country’s Supreme Court. That a similar battle over the control of Nicaragua’s judiciary accompanied the revival of Daniel Ortega and the Sandinista movement is lost on few in San Salvador.

At issue is the FMLN’s attempt to rush through the appointment of judges to the court before the new National Assembly took office in May. The nine-member court ruled that move unconstitutional, along with another set of appointments dating to 2006. Rather than accept this verdict, the Assembly appealed to the regional Central American Court of Justice, which is controlled by Nicaragua’s appointees. Though it has no authority to decide Salvadoran constitutional questions, that tribunal ruled in the FMLN’s favor — creating an impasse in which two rival sets of judges now compete for legitimacy.

Leaders of El Salvador’s civil society, business community and Catholic Church have watched this drama with alarm: They fear that if the FMLN succeeds in subordinating the court it will move to consolidate control over other institutions, including those governing elections. That was the model followed by Mr. Chavez, Mr. Ortega and the leaders of Ecuador and Bolivia. Mr. Sanchez is ideologically in tune with those caudillos; a product of El Salvador’s Communist movement, he is a dedicated anti-American who opposed the country’s adoption of the dollar and the Central American Free Trade Agreement. Four days after the attacks of Sept. 11, 2001, Mr. Sanchez participated in anti-U.S. demonstrations in San Salvador in which American flags were burned.

The Obama administration has expressed concern about the political conflict but avoided taking sides. Like the church, it is urging the opposing parties in the National Assembly to negotiate a solution. Even if the current crisis can be defused, however, the FMLN has picked a leader and embarked on a course that threatens El Salvador’s hard-won stability and democracy. Given its close ties to the country, reinforced by the large Salvadoran immigrant population here, the United States has a strong interest in defending the constitutional order.