Continuous sanctions prevented Iran from acquiring many heavy weapons, such as tanks and aircraft. When the invasion occurred, many pilots and officers were released from prison, or had their executions commuted to combat the Iraqis. In addition, many junior officers were promoted to generals, resulting in the army being more integrated as a part of the regime by the war's end, as it is today. Iran still had at least 1,000 operational tanks and several hundred functional aircraft, and could cannibalize equipment to procure spare parts.