In a blockbuster legal decision, a California judge last night declared the "Don't Ask, Don't Tell" policy that bars gay and lesbian soldiers from serving in the US military to be unconstitutional, saying the ban violated the first and fifth amendment rights of homosexuals and harmed the effectiveness of the armed forces.

"The Don't Ask Don't Tell Act, on its face, violates the constitutional rights" of homosexual troops, US District Court Judge Virginia Phillips said in her ruling.

The decision puts the White House in a quandary, since it comes as the Obama administration is in the middle of a cautious and drawn-out attempt to lift the ban on homosexuals serving openly in the US military.

But those carefully calibrated plans may now be thrown out the window, after Judge Phillips granted a request for an injunction halting "Don't Ask, Don't Tell" from operating, saying evidence showed that it had a "direct and deleterious effect'' on the military.

Phillips said she would issue an injunction barring the government from enforcing the policy. The Department of Justice, which defended "Don't Ask, Don't Tell" during the trial held in Riverside, California, can appeal the ruling.

The case was brought by Log Cabin Republicans, a political organization for gays in the Republican party which claims 19,000 members, in 2004.

Clarke Cooper, executive director of the Log Cabin Republicans, said: "As an American, a veteran and an Army reserve officer, I am proud the court ruled that the arcane Don't Ask, Don't Tell statute violates the constitution. Today, the ruling is not just a win for Log Cabin Republican service members, but all American service members."

The ruling comes just a month after another federal judge in California threw out the state's constitutional amendment banning gay marriage, the Proposition 8 amendment passed by voters in 2008.

The two decisions could together reignite familiar complaints from the right over so-called "activist judges", but more likely growing social tolerance towards homosexuality means that any remaining public hostility towards the the issue will fade quickly.

In her ruling, Judge Phillips mentioned a decline in morale of troops who saw qualified gay and lesbian colleagues forced out of the military because of their sexual orientation.

She also noted that troops suspected of being gay were allowed to serve out their deployments abroad, with investigations and discharges not occurring until their return, demonstrating "that the policy is not necessary."