RAMADI, Iraq – The Islamic State is nearing defeat on the battlefield, but away from the front lines its members are seeping back into areas the group once controlled, taking advantage of rampant corruption in Iraq's security forces and institutions.
Police officers, judges and local officials describe an uneven hand of justice that allows some Islamic State collaborators to walk, dimming Iraq's chances of escaping the cycle of violence that has plagued the country since the 2003 U.S.-led invasion.
In the western city of Ramadi, retaken a year ago, officials say evidence against the accused disappears from police files, while witnesses are too scared to testify. A bribe of as little as $20 can buy a laminated security pass granting access to the city.
In Salahuddin province, a mayor recounted how Islamic State members had returned to his small town, later saying he had received death threats. In Kirkuk, a woman said police were asking for tens of thousands of dollars to release her son, who is accused of helping the militants.
After three years of fighting, security forces are on the cusp of clearing the Islamic State out of Iraqi towns and cities, launching an offensive Sunday for the western half of Mosul, the group's de facto capital in Iraq. But weakened by graft, the state is struggling to maintain control as the Islamic State and rival groups such as al-Qaida attempt to reestablish themselves in areas where they were once supported.
The plight of those majority Sunni areas also provides fodder for extremist groups to drive their recruitment. Parts of towns and cities have been reduced to rubble, with pitiful assistance for reconstruction and hundreds of thousands still displaced from their homes. Meanwhile, accusations of revenge attacks and human rights abuses by security forces have the potential to perpetuate rifts with the government.
The chaos risks unraveling the progress made by Iraqi forces backed by a coalition of allies including the United States, which spends $12.5 million a day on air operations against the Islamic State and has spent billions more training and equipping Iraqi security forces.
"We are very concerned we will end up back at square one," said Eid al-Karbouli, a spokesman for Anbar's provincial council. He said Islamic State members have already started to seep back into the city, adding: "The locals know and recognize them."
It was in the Sunni cities of Anbar province that the Islamic State first gained a hold three years ago, seizing control of Fallujah and Ramadi and capitalizing on frustration with the Shiite-led central government that had manifested in months of protests.
Those areas are back under state control, but the U.S. military's previous struggle against militants in the province is still fresh in the collective memory. Following a U.S. surge in troops and the co-opting of Sunni tribal fighters, then-President George W. Bush traveled to Anbar province in 2007 to highlight the "military success" against al-Qaida. Five years later, the Islamic State formed out of the remnants of the group.
So far, the U.S.-backed campaign has focused on defeating the Islamic State militarily rather than addressing the reasons so many of Iraq's minority Sunnis initially turned to the group.
President Donald Trump has said he instructed his administration to develop a "comprehensive plan" to defeat the Islamic State, but so far he has said little about what that might entail.
Iraqi commanders spearheading the fight complain that they don't have enough competent forces to hold recently recaptured areas. Reformed police forces are again riddled with corruption, and governance has been left to chronically weak institutions.
In Ramadi, Anbar's provincial capital, buildings are scarred by the two-year-long struggle for control between security forces and the Islamic State, the longest period of street-to-street fighting against the group. The government declared victory a year ago, but allegations that the militants are returning are widespread.
At checkpoints on the edges of the city, cars wait in long lines to be allowed in and out. A white laminated pass from Iraq's Interior Ministry allows residents who are not wanted by authorities to travel through freely. But officials say the cards can be bought easily, opening the city up to attack by allowing militants to move in and out.
In his office next to Ramadi's police station, Col. Ahmed Hussein Mohammed, the leader of a regiment of tribal forces in the city, pointed at one of the small cards.
"The most important document right now is this," he said, adding that it costs as little as 25,000 dinars on the black market, or about $20. He says many of the people his forces arrest are soon back out on the streets, with witnesses too afraid to give evidence against them.
Col. Yassir Ismail Moussa, a spokesman for the Anbar police, conceded there was "some corruption at checkpoints" and said there are plans to introduce new identity cards to deal with the issue. Some detainees are rumored to be Islamic State members, he said, but without witnesses or evidence, they must be released.
"This is our problem. Most witnesses don't have courage to come forward," he said, denying that police take bribes to release people or hide evidence.
But others say those problems are rife.
"There is a cancer in the body of the police. We need to get it out, otherwise it will kill us all," Karbouli said. "Right now it's a small fire, but we need to put it out before it becomes a major fire that will burn the whole province."
The Islamic State lost much of the support it had garnered after people experienced living under the group, making it difficult for it to take territory again. Still, there is a problem with "sleeper cells," Moussa said.
In majority Sunni areas like Ramadi, the Islamic State is not the only group attempting to reassert itself.
Last August, al-Qaida leader Ayman al-Zawahiri called on Sunnis in Iraq to reorganize and wage a "long-term guerrilla war" to oust the government from their cities. He urged al-Qaida members in Syria to assist, criticizing the mistakes of his rival, Abu Bakr al-Baghdadi, the leader of the Islamic State.
"No way can al-Qaida come back," Moussa said, adding that al-Qaida members have all switched allegiance to the Islamic State and are on the run in the province, pushed out to its border areas.
But the Institute for the Study of War warned last week that a Sunni insurgency is forming in Iraq and that al-Qaida is trying to gain traction in it. Other Sunni extremist groups, including the Naqshbandis and the 1920s Revolution Brigades, are likely to take advantage, it said.
At the courthouse in Ramadi, Judge Ali Fadhawi said the system is overwhelmed. The ceiling sags from the impact of explosions, a reminder that not too long ago, the building was in the middle of a war zone.
The court tries to dispense justice as best it can, said Fadhawi, but there are not enough judges or police officers.
"All this is not normal. We are sitting here, with the destruction all around us," he said. "What can we do? Life must go on."
Fadhawi said the investigatory court here is dealing with more than 300 terrorism-related cases, but no one has been convicted. He said some of the accused bribe their way out of the system.
"That exists, to be honest, it's happening," he said. But most of the Islamic State's leaders have been killed or have fled, he added. "We do our best in order for none to get away without punishment."
Some residents have taken matters into their own hands.
One warm evening last summer, Mustafa al-Alwani pulled his truck to the side of the street near his home in Ramadi and fired three bullets into another man's chest.
He said the man was an Islamic State member responsible for killing his brother.
"There is no justice here," the 31-year-old policeman explained. "You have to make your own."
The men were members of the same tribe, and Alwani said it was well known that the man was part of a sleeper cell that ambushed police forces in the days before the city fell to the militants. More than a dozen officers were killed, including his brother, whose body was later found in a mass grave, he said.
Alwani filed a legal complaint, but no arrest was made. So he informed the leader of their tribe that he would kill the man unless he left the city.
"After the government didn't do anything, I decided to take my revenge," he said, adding that his brother's killer was previously affiliated with al-Qaida.
Three of Alwani's brothers have been killed by the Islamic State or al-Qaida and another one lost his legs in an attack since the U.S.-led invasion in 2003.
An arrest warrant has now been issued for Alwani, though he said he's not worried and has continued to fight the Islamic State with his police unit in Mosul.
"In Anbar, the law of the tribes is stronger than the law of the government," said Sheikh Omar al-Alwani, a tribal leader. He said that if 10 people signed a petition saying a house belonged to an Islamic State member, the tribe would blow it up.
With tribes and militias often acting as judge, jury and executioner, complaints of extrajudicial killings, beatings and detentions are increasing.
Innocent people inevitably get swept up in the fray.
Lists of accused collaborators contain "an indescribable number" of names, said one intelligence official in Ramadi, who spoke on the condition of anonymity in line with protocol. "On mine there are tens of thousands, but national security, police stations, they all have their own lists."
Those with family members in the Islamic State are often banned from returning home and face revenge attacks. One young man, whose brother was an Islamic State member, described how he was pulled out of his car by tribal militiamen south of Mosul and beaten and robbed because of his family's links to the group. He's now too afraid to be named for fear of reprisals.
In an open letter to Prime Minister Haider al-Abadi, a Facebook page called Mosul Eye, which has chronicled life in the city under the Islamic State, warned that abuses by some parts of the security forces were creating humiliation for the local population, while "huge corruption" meant that Islamic State members were going free.
Fadila Abdelaziz Saleh said her son was accused of working on an Islamic State water tanker in her village south of Mosul. She denies that he did, saying her family fled the village just weeks after the militants arrived.
She discovered the accusations when the village was retaken and families began returning. A list of the wanted circulated on Facebook, and he was on it.
A year ago, security forces arrested her son at their temporary home in a half-constructed building in Kirkuk.
After he was tortured, she said, he confessed to joining the Islamic State for three days and working on the tanker. He also said he guided the militants to two police officers' houses, which were then destroyed.
Sitting on the floor of her icy home, Saleh tried to negotiate her son's release from prison. "I don't have the money to pay $20,000," she cried into her cellphone. "If it was $1,500, maybe I could pay that, maybe a bit more. Maybe if it was $5,000 we could find it."
She said the police had first asked for $35,000.
"If you have money, you can get away with anything," she said.
Mustafa Salim in Ramadi and Aaso Ameen Shwan in Kirkuk contributed to this report.