Last summer, in the days after the group now known as ISIS began its assault across Iraq, many feared that Baghdad could soon fall. Car bombs regularly killed dozens inside the capital. Police and soldiers manned checkpoints across the city. They were Baghdad’s defense and symbols of the state’s power in the face of onslaught. To protect the capital, these cops and soldiers were armed with magic wands. They still are now, nearly a year later.

Across Iraq, members of the security forces carry these magic wands—Rube Goldberg gadgets supposedly designed to detect explosives. The walkie talkie-sized instruments, as ubiquitous in Baghdad as radios are on cops in the United States, are useless pieces of plastic and a required piece of equipment. They were purchased by the Iraqi government for millions of dollars and are still in use to this day, waved around cars like divining rods, two years after a British con man was sentenced to prison for selling them.

Iraqi police officer Salim Abdul Zahra, 33, wielded one of the wands while manning a checkpoint in Baghdad last December. “Want the truth?” Zahra asked after some preliminary explanation about how the detector was supposed to be used. “It is worthless and fake,” he said. “The proof is all the explosions that still happen here.”

But though the wand didn’t work, he said he had to wave it around. Ultimately, if he didn’t use the wand, which he and his fellow officers knew was worthless, he would stick out. “What I can do?” he asked. “I follow the orders and use it.”

At a second checkpoint, soldier Ali Ahmed Hussein, 29, held a wand in his hand, which he would resume using after the interview. He said he knew that the British businessman who sold them had been sent to prison. “What about the people in the Iraqi government who made the deal with him?” he asked. “When will their turn come?”

Today, not only are the wands still in use, they are traded on a black market. According to Iraqi legal analyst Zaid Al-Ali, they can sell for as much as $50,000, despite the fact that everyone involved in the exchange knows they are fake.

The wands provide a visible symbol of Iraq’s rampant corruption. They were bought despite warnings that they didn’t work and kept in service after it was proved they didn’t work. A 2010 investigation into their purchase ended before it started, without any officials held accountable, after Iraq’s interior minister used an article in the country’s criminal code that gives senior officials control over whether their subordinates are prosecuted for corruption.

The wands also illustrate how that corruption impedes Iraq’s war against the Islamic State, known as ISIS, which seems to make up for its defeats by regaining a piece of territory every time it loses one. For the Iraqi government, jeopardizing the capital’s security, as serious a matter as there is for a country at war against an internal enemy, is still apparently preferable to publicly acknowledging that a fraud occurred and exposing top officials to punishment.

On their way to becoming staples of Baghdad checkpoints, the phony bomb detectors were sold to a number of countries by British businessman named James McCormick. Iraq was his largest buyer. McCormick took a device designed to find golf balls, repackaged it as the ADE-651, and promised that it could detect everything from drugs and currency to bombs—and even do it through walls.

In 2007 Iraq’s government began spending a little more than $8,000 apiece on average to buy handheld ADE-651s. By 2009 Baghdad’s Interior Ministry had purchased $85 million worth of junk. More than 1,000 Iraqis were killed and many more were injured by explosions during that period. In 2010 McCormick was arrested on suspicion of fraud by British authorities. He was sentenced to 10 years in prison in 2013 by a British judge who called his business a “callous confidence trick.”

By now, it should be obvious to both Baghdad and Washington that state graft is a serious impediment to fighting ISIS. In December 2014 Iraq ranked as the sixth most corrupt country in the world on the annual Corruption Perceptions Index, produced by the German NGO Transparency International. And despite a new prime minister who has pledged to fight corruption, there is little evidence of systemic reform.

“The government in Maliki’s era was corrupt and strong; now it is corrupt and weak,” said Dr. Abbas Kadhim, a senior foreign policy fellow at Johns Hopkins University, in a recent interview about the legacy of former Iraqi leader Nouri al-Maliki and current Prime Minister Haider al-Abadi.

Baghdad’s corruption, observed the journalist Sajad Jiyad, “is so organized and so entrenched that even the highest authorities tread carefully.” Jiyad related an anecdote from his trip to Iraq at the beginning of the year about a military procurement officer attempting to steal tens of millions of dollars intended to buy bulletproof vests for security forces while making an extra profit selling knockoffs of the vests he never purchased.

The U.S. is now training the Iraqi army as it did for almost a decade while the U.S. military occupied Iraq. Yet despite the previous years of training and $25 billion spent on the effort, Iraq’s military collapsed in the face of ISIS’s initial onslaught last year. Zaid Al-Ali wrote of the Iraqi military’s performance in Tikrit, as witnessed by a resident of the city who saw it captured by ISIS: “a contingent of just thirty militants in seven vehicles had seized control in the time it took him to have his nap. Iraq’s security forces, on which 100 billion dollars of Iraq’s money had been spent between 2006 to 2014, had simply melted away.”

That legacy continues in the description Al-Ali provides of Tikrit’s post-liberation fate:

“One month after ISIS’s defeat, many locals who had left still consider it too dangerous to return to Tikrit. Since the liberation, hundreds of criminals have been operating freely, looting and destroying property. In one district, more than a quarter of the homes were destroyed after its liberation, and reports of property destruction are still coming in. The elected provincial council and the governor have not been able to return to the city. Municipal services have yet to be restored and few businesses have reopened. Many Tikritis are furious at the army and the police’s failure to restore order, and the government’s refusal to acknowledge the problem.”

There are far larger battles still to be fought. Mosul, ISIS’s stronghold in Iraq, is more than 10 times larger than Tikrit in square miles. It’s also farther from Baghdad’s supply lines and military headquarters. Meanwhile, ISIS is resurgent in Anbar province. Retaking territory will require Baghdad to field a fighting force among disparate groups—Sunni tribes, Shia militias, the Kurdish Peshmerga, and the uniformed military—that range from mutually suspicious to hostile. There’s not enough money in Baghdad, or coming from outside, to buy all their loyalty. Convincing these groups to join in a unified effort will require the skill to arbitrate between their claims and persuade them to believe in the pledges coming from the government, if not yet its final legitimacy. Dropping the magic wands is only a first step.