SAN SALVADOR, El Salvador — A judge in El Salvador has acquitted 18 people accused of illicit association for actions related to a 2012 gang treaty that temporarily lowered El Salvador’s homicide rate.

Judge Godofredo Salazar ruled the 17 ex-government officials on trial were acting under orders from then Security Minister David Munguia.

The other defendant was Raul Mijango, a onetime guerrilla who brokered the treaty. But the judge ruled Tuesday that Mijango had essentially been commissioned to do that by Munguia.

Some had faced charges of conspiracy for introducing contraband into prisons or providing imprisoned gang leaders with cellphones or other privileges during the negotiations. Three police officials also faced charges.

In 2012, the leaders of the Mara Salvatrucha and Barrio 18 gangs agreed to curb killings. The truce dissolved in September 2013.