(CNN) -- A imprisoned former Mexican general has been released for lack of evidence nearly a year after his arrest on corruption charges.
Retired Gen. Tomas Angeles Dauahare, along with three other high-ranking military leaders, was accused of ties to drug traffickers. He was arrested in May and formally charged in August.
The arrests shook confidence in the military, which under former President Felipe Calderon had done the heavy lifting in the offensive against drug cartels. The military was chosen to go after the cartels because it was seen as less corruptible than local and state forces.
At the time of the arrests, lawmakers lamented what they said could be one of the highest-level corruption cases in Mexico's recent history.
Since then, a new president and new attorney general assumed posts, and in January prosecutors said they had no evidence to incriminate Angeles Dauahare.
A judge on Wednesday ordered the retired general's release, and the attorney general's office agreed with the order.
Angeles Dauahare walked out of prison Wednesday night wearing gray sweats and tennis shoes.
The accusations against him were defamatory and false, he told reporters, calling himself "a victim of the last (presidential) term."
Other generals who remain in custody for alleged ties to organized crimes will also be freed, he predicted.
Angeles Dauahare was arrested last year together with Brig. Gen. Roberto Dawe Gonzalez, retired Lt. Col. Silvio Isidro de Jesus Hernandez Soto and retired Gen. Ricardo Escorcia Vargas, a former deputy defense secretary.
CNNMexico's Mauricio Torres and CNN's Catherine E. Shoichet contributed to this report.