BAGHDAD (AP) -- While attending the Iraqi army's artillery school nearly 20 years ago, Ali Omran remembers one major well. An Islamic hard-liner, he once chided Omran for wearing an Iraqi flag pin into the bathroom because it included the words "God is great."
"It is forbidden by religion to bring the name of the Almighty into a defiled place like this," Omran recalled being told by Maj. Taha Taher al-Ani.
Omran didn't see al-Ani again until years later, in 2003. The Americans had invaded Iraq and were storming toward Baghdad. Saddam Hussein's fall was imminent. At a sprawling military base north of the capital, al-Ani was directing the loading of weapons, ammunition and ordnance into trucks to spirit away. He took those weapons with him when he joined Tawhid wa'l-Jihad, a forerunner of al-Qaida's branch in Iraq.
Now al-Ani is a commander in the Islamic State group, said Omran, who rose to become a major general in the Iraqi army and now commands its 5th Division fighting IS. He kept track of his former comrade through Iraq's tribal networks and intelligence gathered by the government's main counterterrorism service, of which he is a member.
It's a common trajectory.
Under its leader, Iraqi jihadi Abu Bakr al-Baghdadi, the Islamic State group's top command is dominated by former officers from Saddam's military and intelligence agencies, according to senior Iraqi officers on the front lines of the fight against the group, as well as top intelligence officials, including the chief of a key counterterrorism intelligence unit.
The experience they bring is a major reason for the group's victories in overrunning large parts of Iraq and Syria. The officers gave IS the organization and discipline it needed to weld together jihadi fighters drawn from across the globe, integrating terror tactics like suicide bombings with military operations. They have been put in charge of intelligence-gathering, spying on the Iraqi forces as well as maintaining and upgrading weapons and trying to develop a chemical weapons program.
Patrick Skinner, a former CIA case officer who has served in Iraq, said Saddam-era military and intelligence officers were a "necessary ingredient" in the Islamic State group's stunning battlefield successes last year, accounting for its transformation from a "terrorist organization to a proto-state."
"Their military successes last year were not terrorist, they were military successes," said Skinner, now director of special projects for The Soufan Group, a private strategic intelligence services firm.
How officers from Saddam's mainly secular regime came to infuse one of the most radical Islamic extremist groups in the world is explained by a confluence of events over the past 20 years -- including a Saddam-era program that tolerated Islamic hard-liners in the military in the 1990s, anger among Sunni officers when the U.S. disbanded Saddam's military in 2003, and the evolution of the Sunni insurgency that ensued.
The group's second-in-command, al-Baghdadi's deputy, is a former Saddam-era army major, Saud Mohsen Hassan, known by the pseudonyms Abu Mutazz and Abu Muslim al-Turkmani, according to the intelligence chief. Hassan also goes by Fadel al-Hayali, a fake name he used before the fall of Saddam, the intelligence chief told The Associated Press. Like others, he spoke on condition of anonymity to discuss the intelligence.
During the 2000s, Hassan was imprisoned in the U.S.-run Bucca prison camp, the main detention center for members of the Sunni insurgency, where al-Baghdadi also was held. The prison was a significant incubator for the Islamic State group, bringing militants like al-Baghdadi into contact with former Saddam officers, including members of special forces, the elite Republican Guard and the paramilitary force called Fedayeen.
In Bucca's Ward 6, al-Baghdadi gave sermons and Hassan emerged as an effective organizer, leading strikes by the prisoners to gain concessions from their American jailers, the intelligence chief said.
Former Bucca prisoners are now throughout the IS leadership. Among them is Abu Alaa al-Afari, a veteran Iraqi militant who was once with al-Qaida and now serves as the head of IS's "Beit al-Mal," or treasury, according to a chart of what is believed to be the group's hierarchy provided to the AP by the intelligence chief.
Al-Baghdadi has drawn these trusted comrades even closer after he was wounded in an airstrike earlier this year, the intelligence chief said. He has appointed a number of them to the group's Military Council, believed to have seven to nine members -- at least four of whom are former Saddam officers. He brought other former Bucca inmates into his inner circle and personal security.
Saddam-era veterans also serve as "governors" for seven of the 12 "provinces" set up by the Islamic State group in the territory it holds in Iraq, the intelligence chief said.
Iraqi officials acknowledge that identifying IS leadership is an uncertain task. Besides al-Baghdadi himself, the group almost never makes public even the pseudonyms of those in its hierarchy. When leaders are killed, it's often not known who takes their place -- and several have been reported killed multiple times, only to turn up alive. Figures are believed to take on new pseudonyms, leaving it unclear if a new one has emerged or not.
"IS's military performance has far exceeded what we expected. The running of battles by the veterans of the Saddam military came as a shock," a brigadier general in military intelligence told the AP, speaking on condition of anonymity to discuss the sensitive topic. "Security-wise, we are often left unable to know who replaces who in the leadership. We are unable to infiltrate the group. It is terrifying."
Estimates of the number of Saddam-era veterans in IS ranks vary from 100 to 160 in mostly mid- and senior-level positions, according to the officials. Typically, they hail from Sunni-dominated areas, with intelligence officers mostly from western Anbar province, the majority of army officers from the northern city of Mosul and members of security services exclusively from Saddam's clan around his hometown of Tikrit, said Big. Gen. Abdul-Wahhab al-Saadi, a veteran of battles against IS north and west of Baghdad.
For example, a former brigadier general from Saddam-era special forces, Assem Mohammed Nasser, also known as Nagahy Barakat, led a bold assault in 2014 on Haditha in Anbar province, killing around 25 policemen and briefly taking over the local government building.
Many of the Saddam-era officers have close tribal links to or are the sons of tribal leaders in their regions, giving IS a vital support network as well as helping recruitment. These tribal ties are thought to account, at least in part, for the stunning meltdown of Iraqi security forces when IS captured the Anbar capital of Ramadi in May. Several of the officers interviewed by the AP said they believe IS commanders persuaded fellow tribesmen in the security forces to abandon their positions without a fight.
Skinner, the former CIA officer, noted the sophistication of the Saddam-era intelligence officers he met in Iraq and the intelligence capabilities of IS in Ramadi, Mosul and in the group's de facto capital of Raqqa in Syria.
"They do classic intelligence infiltration. They have stay-behind cells, they actually literally have sleeper cells," Skinner said.
"And they do classic assassinations, which depends on intelligence," he said, citing a wave of assassinations in 2013 that targeted Iraqi police, army, hostile tribal leaders and members of a government-backed Sunni militia known as Sahwa. Knowing who to assassinate and how to get to them requires good information, Skinner said, and the IS obviously knew how to acquire it.
One initiative that eventually fed Saddam veterans into IS came in the mid-1990s when Saddam departed from the stringent secular principles of his ruling Baath party and launched the "Faith Campaign," a state-sponsored drive to Islamize Iraqi society. Saddam's feared security agencies began to tolerate religious piety or even radical views among military personnel, although they kept a close watch on them and saw to it they did not assume command positions.
At the time, the move was seen as a cynical bid to shore up political support among the religious establishment after Iraq's humiliating rout from Kuwait in the 1991 Gulf War and the Kurdish and Shiite uprisings that followed.
"Most of the army and intelligence officers serving with IS are those who showed clear signs of religious militancy during Saddam days," the intelligence chief said. "The Faith Campaign ... encouraged them."
In the run-up to the 2003 U.S.-led invasion, Saddam publicly invited foreign mujahedeen to come to Iraq to resist the invaders. Thousands came and Iraqi officials showed them off to the media as they were trained by Iraqi instructors. Many stayed, eventually joining the insurgency against American troops and their Iraqi allies.
After the collapse of the Saddam regime, hundreds of Iraqi army officers, infuriated by the U.S. decision to disband the Iraqi army, found their calling in the Sunni insurgency. In its early stages, many insurgent groups were relatively secular. But Islamic militants grew in prominence, particularly with the creation and increasing strength of al-Qaida in Iraq. Some Sunnis were radicalized by bitterness against the Shiite majority, which rose to power after Saddam's fall and which the Sunnis accuse of discriminating against them.
Al-Qaida in Iraq was initially led by a Jordanian militant, Abu Musab al-Zarqawi, and had a strong foreign presence in its leadership. But after al-Zarqawi's death in a 2006 U.S. airstrike, his Iraqi successor, Abu Omar al-Baghdadi, began to bring in more Iraqis, particularly former Saddam officers. That process was accelerated when Abu Bakr al-Baghdadi took over after his predecessor was killed in a 2010 airstrike.
Abu Bakr al-Baghdadi's first two deputies, who each played a major role in setting up what would become its sweep over Syria and Iraq, were both Saddam-era officers, according to those interviewed by the AP. They were Sameer al-Khalifawy, an air force colonel killed in fighting in Syria in 2014, and Abdullah el-Bilawy, a former intelligence officer who was killed in Mosul by the Iraqi military in May 2014, a month before the city fell to the Islamic State group. He was replaced by the current deputy, Hassan.
"It's clear that some of these (Saddam-era officers) must have been inside the core of the jihadist movement in the Sunni triangle from the beginning," said Michael W.S. Ryan, a former senior executive at the State Department and Pentagon, referring to the Sunni-dominated area that was the most hostile to American forces in Iraq.
"Their knowledge is now in the DNA of ISIS," he said, using an alternate acronym for the extremist group.
"This melding of the Iraqi experience and what we might call the Afghan Arab experience became the unique ISIS brand," said Ryan, now a senior fellow at the Jamestown Foundation, a Washington-based think tank.
"That brand ultimately became more successful in Iraq than al-Qaida in Iraq ... and, at least for now, stronger in Syria than al-Qaida."
Associated Press writer John-Thor Dahlburg contributed to this report from Brussels, Belgium.