A court in El Salvador sentenced former President Mauricio Funes and his justice minister to over a decade behind bars for their ties with criminal groups and failure to comply with duties, the attorney general’s office said in a tweet on Monday.

Funes was sentenced to 14 years and former justice and defense minister, David Munguia, to 18.

“We were able to verify that these two former officials, who had the obligation to protect Salvadorans, negotiated their lives in exchange for electoral favors, acting as gang members,” Attorney General Rodolfo Delgado said on Twitter.

Munguia was first put under arrest in 2020 for suspicion of unlawful association and other crimes linked to the alleged arrangement of a truce between gangs aimed at reducing homicides in exchange for undisclosed benefits to the criminal organizations.

Funes, who governed from 2009 to 2014 and lives in Nicaragua, was granted Nicaraguan citizenship in 2019.

The Nicaraguan constitution holds that no citizen may be extradited.

Funes, Munguia and their lawyers did not immediately reply to a request for comment.

“Those engaged in backroom deals at the expense of the blood of Salvadorans have been sentenced to pay in prison for the damage caused to society,” Justice Minister Gustavo Villatoro said on Twitter.

El Salvador has been living under a state of emergency declared by the government of President Nayib Bukele for more than a year.

The measure, which has led to the arrest of over 68,000 people presumed to be gang members, is widely popular among Salvadorans. But it has been criticized by human rights groups citing arbitrary arrests, torture and deaths of prisoners in custody.

Official data shows 5,000 of the prisoners have been released, as authorities found no ties to criminal groups.