BAGHDAD - On July 21, the temperature spiked to a sweltering 107 degrees in Baghdad - brutal heat for the guards and prisoners inside Abu Ghraib's cement confines.

Outside, among a patchwork of green farmland and dry brown fields, federal police and army troops - packing AK-47s, PKC machine guns and sniper rifles - were positioned throughout the terrain, which is dotted with Sunni farms and villages where insurgents had once launched a guerrilla war against U.S. troops.

Within the walls of the infamous prison, the guards - armed only with pepper spray and clubs - were the last line of defense from would-be assailants.

At around 9 p.m. that night, as detainees were being counted on the way back to their cells after dinner, the mortars began to fall.

A barrage of more than 40 rounds hit the grounds in rapid succession - some counted as many as 100 explosions. As guards and detainees scrambled for cover, two car bombs exploded outside, punching a hole in the walls of the massive prison compound.

More than 50 gunmen wearing tribal robes then entered the grounds, wielding pistols, AK-47s, and hand grenades. They had been on the road and in nearby villages, waiting to storm the facility. The power was cut, and the detainees broke out in cries of "God is great."

The gunmen opened fire on any officer they saw. "The prisoners rioted. Some burned mattresses and clothes, others had stored homemade explosives to hurl at the guards. The infiltrators handed weapons to their jailed comrades. There was screaming and chaos," one of the guards at Abu Ghraib recalled. "We were surrounded."

When the assault ended, 71 prisoners were dead but hundreds of hardened militants had been freed in a stunning attack by al-Qaida's local subsidiary. The exact number is still unclear: The Iraqi government estimated anywhere from 300 to more than 850 detainees, including some arrested by U.S. forces years ago, had been busted out. The fact that the Iraqi security apparatus still does not know exactly how many militants escaped is a stunning admission of incompetence - and a testament to how badly it was knocked off balance by the assault.

It's not just this one prison break - there are signs that militants are gaining momentum across the country. Iraq just witnessed its deadliest month since the end of its civil war in 2008: The United Nations announced last week that 1,057 Iraqis had been killed in July.

Al-Qaida's assaults are also becoming more sophisticated. The July 21 attack was coordinated with an assault on Taji Prison, the other main detention facility just north of Baghdad, though no detainees were freed there. Militants have also grown expert at staging coordinated car bombings - like the wave of attacks on July 29, when 15 car bombs struck Shiite neighborhoods across the country, killing at least 50 people and injuring over 1,000.

The Abu Ghraib prison break was not only a counterterrorism disaster, it laid bare Iraq's political dysfunction. Al-Qaida in Iraq has dashed the hopes of U.S. and Iraqi officials who banked that the 2007-2008 "surge" destroyed the movement, taking advantage of the country's poisonous sectarian politics to regain its strength. Sen. John McCain, R-Ariz., blamed America's failure to leave a residual U.S. force in the country for the attack. "We won the peace and lost the war. It is really tragic," he said. "And those people who are out of Abu Ghraib now, they are heading right to Syria."

Indeed, Syria's descent into civil war has bolstered al-Qaida's fortunes in the region. The group now identifies itself as the Islamic State of Iraq and the Levant, in a nod to the fact that its cross-border ambitions stretch from Damascus to Baghdad. While al-Qaida has yet to deploy fighters from Syria for attacks in Iraq, according to a former insurgent, some Syrian jihadists have fled into Iraq and received weapons from Sunni tribes.

In addition to using the Syrian conflict to bolster its reputation among disaffected Sunnis, al-Qaida has sought to recruit supporters by exploiting missteps by Iraq's Shiite-led government. In its statement claiming responsibility for the jail break, the Islamic State of Iraq and the Levant said their operation was carried out as reprisal for the shooting of peaceful Sunni protestors in the northern city of Hawija in April, where security forces killed more than 50 mostly unarmed Sunni protesters.

Meanwhile, the Abu Ghraib prison break debacle has sowed dissension among Iraq's political elite, as members of the ruling class blamed each other for the fiasco.

The rancor started at the top. Prime Minister Nouri al-Maliki accused a key political partner and rival, Shiite cleric Muqtada al-Sadr's followers, who make up a large number of the rank-and-file prison guards in Iraq's penitentiary system, of assisting al-Qaida. "What happened in Abu Ghraib prison was the guards who were inside the prison, are connected to these militias, and it was they who colluded and it was they who opened the doors," Maliki said. The Sadr movement, which holds several government ministries, responded with their own statement mocking the prime minister for "losing his mind."

In turn, Justice Minister Hassan Shimmari blamed the security forces for assisting the prison break. "I had the impression that there was a collusion," Shimmari said on television, saying checkpoints around the prison had been abandoned. "The 120 policemen responsible for this area all disappeared except for an officer and two cops."

Admission after admission has come out in the local media: 200 Sunni prisoners, some of them from al-Qaida, had been transferred to Abu Ghraib just days before the escape; prisoners had easy access to cell phones, so were able to communicate with the prison break plotters in the countdown to the escape. The attack has demoralized Iraqis. Shiite religious clerics have publicly questioned the competence of the security forces and drubbed the government for letting down the families of terror attack victims. "As the criminals return, people will feel depression, frustration, fear and panic," said Sheikh Abdel Mehdi Karbalai, a senior representative of Grand Ayatollah Ali Sistani, the most revered Shiite religious figure in Iraq.

Meanwhile, the surviving guards are angry that they are being treated as accomplices rather than the victims. The justice minister and deputy minister visited them shortly after the attack, in the middle of the night, and continued pointing fingers. "They were blaming us for what happened," one of the guards said.

The guard, however, believes that the corruption that allowed such a disaster reaches much higher up the Iraqi political system. "We are under the impression that some elements from the government and the security troops helped the gunmen," the guard said. "How could so many prisoners disappear within minutes after they left the prison?"

For al-Qaida, the political infighting was icing on the cake of an immensely successful operation. The terror group boasted about the operation in a lengthy statement, bragging that it had "freed the lions" from the "Safaween," or Safavids, a derogatory term for Shiites.

The guards were stunned at the brutality of the assault. One guard pretended to be dead, lying in a pile of his fellow guards' corpses. An al-Qaida fighter was checking the bodies for the living, executing anyone who was still breathing. The guard, who had been shot in the leg, covered himself in blood. A fighter tried to kick his body over, but gave up and moved on. "Thank God, I am still alive," the guard said.

Another guard recalled watching a colleague call out to the shooters: "I am from Abu Ghraib, my name is Othman Omar," a Sunni name. The gunmen assured him he would be safe if he came out, since he belonged to their sect - when he approached, they shot him dead. Gunmen held one policeman at gunpoint and took his pistol and badge, telling another fighter, "We can use this." Al-Qaida claims they killed more than 100 security forces in the raid; official Iraqi government figures put the number at 10.

The Abu Ghraib prison break may be over, but its effects will reverberate around Iraq and the broader region for many months to come. The men who carried it out are still on the loose, ready to carry out more bombings, stronger than ever. The guards, meanwhile, marveled at the jihadists' confidence and cool.

"They seemed not to be in a rush, they were doing what they wanted, with no confusion," one guard said. "They knew what to do."

• -

Raheem Salman is a correspondent with Reuters in Baghdad and a former staffer with the Los Angeles Times. Ned Parker is the former Baghdad bureau chief for the Los Angeles Times and the 2011-2012 Edward R. Murrow Fellow at the Council on Foreign Relations.