HUMAN-RIGHTS watchers gulped when Turkey stripped more than 100 parliamentarians of their immunity from prosecution on May 20th. Recep Tayyip Erdogan, the country’s increasingly authoritarian president, said that Turks “do not want to see guilty lawmakers in this parliament”. These words would strike a chord with many others around the world. In 2014 one-third of the MPs elected to India’s parliament faced criminal charges. In Brazil around 60% of Congressmen face accusations of criminal wrongdoing. Despite this, most developing countries—and some western European ones—grant blanket immunity from prosecution to lawmakers, often to the displeasure of their own citizens. Why are these politicians held above the law?

There are two general systems of immunity. Britain, America and others grant “narrow” immunity: MPs can vote and speak freely in Parliament or Congress without worrying about potential lawsuits or criminal charges. The “wider” concept of immunity is more controversial: some fortunate lawmakers enjoy immunity from all kinds of prosecution, which can only be lifted with a parliamentary vote. Its critics say such a system lets politicians act with impunity and encourages criminals to run for office. They are right. Romania’s parliament spent much of 2015 refusing to lift the immunity of an MP accused of taking bribes. In 2006 an untouchable Egyptian MP denied wrongdoing even after customs found 1,700kg of Viagra illegally imported in his company’s name. And in 1982 Pablo Escobar, a murderous drug baron, won immunity after his election to Colombia’s House of Representatives. These cases undermine public faith in state institutions and in democracy itself. So, the argument goes, immunity should be killed off.

But if immunity laws cause havoc, they also help to curb it—by safeguarding the separation of powers. In a fragile democracy, where the rule of law is weak and the judiciary is often corrupt, lawmakers risk prosecution on politically motivated charges by the executive branch. If left unchecked, the executive would cow or arrest opposition MPs in order to boost its power and reduce its accountability. This feeds corruption and damages democracy, too. Ironically, the countries where immunity is most needed are the very countries where it is most prone to abuse. This presents a conundrum for Western policymakers. For some time Ukrainians have named lifting lawmakers’ immunity as their most desired anti-corruption measure. Last year the European Union demanded that Ukraine abolish immunity as a condition of a visa-free travel deal. Ukraine's president agreed. But after a report from the EU’s legal counsel warned of the possible consequences, the demand was dropped.

Weakening the legislature in a nascent democracy will not fix corruption by itself. A better way to tackle graft is to slowly reform all branches of government at the same time, says Michael Meyer-Resende of Democracy Reporting International, a think-tank. Immunity's greatest drawback is not that it is too powerful, but that it is not powerful enough. Parliamentary immunity in Turkey was no obstacle once Mr Erdogan decided he wanted to slay his political opponents. Cambodia’s president recently ordered the arrest of opposition politicians without bothering to lift their immunity. And last year Russia’s parliament voted to scrap the immunity of the only lawmaker who voted against the annexation of Crimea. In a rotten system, immunity will not save you.