Barack Obama's efforts to end the inequity that leaves millions of Americans without healthcare insurance suffered a blow today when a federal judge ruled the entire reform package unconstitutional.

A federal judge in Florida agreed with a coalition of 26 states from across the US that the provision in the law to oblige individuals to buy health insurance was in breach of their personal rights.

Judge Roger Vinson said that the objection to this specific part of the legislation had an impact on all the other reforms and so he found against the whole law.

The ruling is unlikely to have an immediate effect on the prospects of health reform in the country, not least because this provision does not come into effect until 2012 in any case. But the judge's decision is the most severe setback for Obama over one of the signature measures of his first two years in the White House.

It is also likely to speed the journey of the healthcare reforms up the judicial food chain until it reaches the US supreme court for a final judgment.

The Justice Department reacted to the ruling by immediately questioning the right of the lower courts to stand in judgment on the federal government. "We are confident we will ultimately win on appeal," said the department's spokeswoman Tracy Schmaler.

Vinson gave his controversial ruling in the district court in Pensacola, a conservative region in the conservative state of Florida. The action was joined by states right across the country, from Maine in the north-east, Mississippi in the south to Alaska in the north-west.

Vinson's 78-page ruling hinged on the argument that by requiring people to buy healthcare insurance the government could set a precedent that would upset the free flow of food across state boundaries.

"Congress could require that people buy and consume broccoli at regular intervals," he wrote.

This is just the latest in a growing line of attacks on the healthcare reforms, which Obama has made a centrepiece of his first term in office.

A court in Virginia has already ruled against the individual requirement to buy insurance on constitutional grounds, though it stopped short of an outright rejection of the law.

The House of Representatives, newly dominated by the resurgent Republican party, has also passed a bill overturning the reforms.