FOR the “bitter” Americans Barack Obama accused in 2008 of “clinging” to their guns (and religion), this has been a sweet week. In June of that year five of the nine justices on the Supreme Court ruled in DC v Heller that the right to bear arms set out in the second amendment really did apply to individuals and not just to the “well regulated militia” in the arguably ambiguous sentence that ends by saying “the right of the people to keep and bear arms, shall not be infringed.” Now, almost exactly two years later, and again by five votes to four, the court has ruled, in McDonald v Chicago, that this right must be acknowledged by state and local governments and not only by the federal one.

The two findings, taken together, represent a big step forward for the gun lobby. Heller ruled that the second amendment should be construed as a personal right to keep and bear arms for lawful purposes, most notably for self-defence within the home. It struck down a handgun ban in Washington, DC, as unconstitutional. But because the capital is an enclave of the federal government, the ruling did not resolve the status of similar bans elsewhere.

Otis McDonald and his fellow plaintiffs in McDonald wanted to keep handguns for protection but were prohibited from doing so by ordinances in Chicago. The court has now ruled that under the “due process” clause of the 14th amendment the right to bear arms cannot be infringed by either the states or the federal government. Alan Gottlieb, vice-president of the Second Amendment Foundation, said that as a result of McDonald “the right of the individual citizen to have a gun is constitutionally protected in every corner of the United States.” He says that his organisation is preparing challenges against restrictive anti-gun laws across the country, in order to “win back our firearms freedoms one lawsuit at a time”. The National Rifle Association says that it, too, is planning legal challenges to gun laws across the country; it claims there are 20,000 of these.

And yet campaigners for gun control have not been cast into utter gloom. They are consoled by the fact that in this week's ruling Justice Samuel Alito, writing for the majority, made a point of repeating something else the court said in Heller: the right to keep and bear arms is not “a right to keep and carry any weapon whatsoever in any manner whatsoever and for whatever purpose”. The court emphasised two years ago that it was not questioning longstanding regulations such as preventing felons and the mentally ill from owning guns, or keeping guns out of sensitive places such as schools or government buildings. “We repeat those assurances here,” wrote Mr Alito in the new opinion.

The Brady Campaign to Prevent Gun Violence, a bipartisan movement that advocates gun control, did its best to put on a brave face, claiming to welcome the court's rejection of the gun-lobby argument that its “any gun, for anybody, anywhere” agenda was protected by the constitution. Paul Helmke, the campaign's president, noted that the court had again recognised that the second amendment allowed “for reasonable restrictions on firearms, including who can have them and under what conditions, where they can be taken, and what types of firearms are available.” Criminal-background checks, which states or cities can require, are rising (see chart).

But who is to decide which restrictions are reasonable and which offend against what the Supreme Court has now declared to be a fundamental right? That battle will now return to the lower courts. Blanket or near-blanket bans on the possession of handguns, such as those in Chicago and the adjacent city of Oak Park, will almost certainly be struck down. But these are very rare. In the case of most other regulations McDonald offers little guidance. Can assault weapons be banned? Can guns be banned from public places? Should there be rules on how they are stored at home? Should they be registered? In a dissenting opinion, Justice Stephen Breyer berated the majority for setting the judges on lower courts a “mission-almost-impossible”.

If the jurisprudence of gun control is treacherous, the politics are a nightmare. In an average year more than 100,000 Americans are shot by guns, more than 30,000 fatally. And yet support for stricter gun controls is declining—from 59% in 1994 to 40% last April, according to a CBS News poll last April. Gun-control regulations tend to be popular in cities and unpopular, often deeply so, in rural areas.

For that reason, the Democrats may be pleased that the Supreme Court has at last entrenched the second amendment so firmly. This makes it harder for Republicans to scare voters into believing that a Democratic president intends to take their guns away. The sale of guns surged after Mr Obama's election, perhaps because the clingers believed they had to stock up while they still could. Harry Reid, the Democratic majority leader in the Senate, who faces a tough re-election battle in Nevada in November, was quick to give the McDonald ruling a warm welcome. “The right to bear arms”, he said, “is one of the essential freedoms on which our country was founded.” And it will be earning money for lawyers for years to come.