The Iraqi Islamic party, a Sunni group, said in a statement that it "considers today as a black mark and a grave setback in the history of the Iraqi judiciary system".
"What has happened today is a big mistake that should be corrected immediately - otherwise, the country will be drawn into disaster."
Alleged al-Mahdi Army linkThe officials allegedly used their positions to help the al-Mahdi Army, a militia loyal to Muqtada al-Sadr, the Iraqi Shia leader.
Al-Zamili and al-Shimmari were accused of involvement in a wave of sectarian violence that gripped Iraq after the bombing of the Samarra mosque in 2006.
Prosecutors charged that the fighters were given access to public hospitals and ambulances.
A US military statement issued after al-Zamili's 2007 arrest said that he was believed to have siphoned millions of dollars from the ministry to the al-Mahdi Army "to support sectarian attacks and violence targeting Iraqi citizens".
Once freed from a US-run detention facility, supporters took al-Zamili and al-Shimmari back to their homes to celebrate the court verdict.