Libya's Defence Minister Mohammed al-Barghathi resigned on Tuesday due to a crisis caused by gunmen who have besieged two ministries for more than a week, a ministry official said. "The minister has resigned citing the siege imposed on the state institutions in Libya," the official told AFP on condition of anonymity. The militiamen have surrounded the ministries of justice and foreign affairs to demand the removal from public posts of former officials of the regime of slain dictator Moamer Kadhafi. Barghathi's resignation appears to have been motivated by a law passed Sunday that excludes former regime officials from public posts. He served as an air force commander in the Kadhafi regime. The controversial law passed by Libya's General National Congress is expected to take effect within a month.