U.S. District Judge Virginia Phillips ruled Thursday that the prohibition on openly gay service members was unconstitutional because it violates the First and Fifth Amendment rights of gays and lesbians.
The policy doesn't help military readiness and instead has a "direct and deleterious effect" on the armed services by hurting recruitment efforts during wartime and requiring the discharge of service members who have critical skills and training, she said.
The Log Cabin Republicans sued the federal government in 2004 to stop the policy. Phillips will draft the injunction with input from the group within a week, and the federal government will have a week to respond.
Government lawyers said the judge lacked the authority to issue a nationwide injunction.
The U.S. Department of Justice can appeal the ruling but the government has not announced what it intends to do.
The Pentagon on Friday referred questions on the ruling to the Justice Department, where spokesman Charles Miller said it was being reviewed by attorneys.
Defense Secretary Robert Gates and Joint Chiefs of Staff Chairman Adm. Mike Mullen - both in favor of repealing "don't ask, don't tell" - have said they prefer that the change wait until the military completes its review of the issue. That study, due in December, includes surveys of troops and their families to get their views and help figure out how a change would be implemented.
The Log Cabin Republicans' case was the biggest legal test of the law in recent years and came amid promises by President Barack Obama that he will work to repeal the policy.
"This decision will change the lives of many individuals who only wanted to serve their country bravely," said the group's attorney, Dan Woods.
More than 13,500 service members have been fired since 1994, the Log Cabin Republicans said.
During the nonjury trial, Woods argued that the policy violates gay military members' rights to free speech, open association and right to due process as guaranteed by the Fifth Amendment.
He said the ban damages the military by forcing it to reject talented people as the country struggles to find recruits in the midst of a war. He also used Obama's remarks and those of top military commanders as evidence that the policy should be overturned.
The case is unique because it wasn't based on one individual's complaint about a discharge. Instead it made a broad, sweeping attack on the policy.
Government attorneys presented only the policy's legislative history in their defense and no witnesses or other evidence.
Justice Department attorney Paul G. Freeborne argued the policy debate was political and that the issue should be decided by Congress rather than in court.
In his closing arguments, he said the plaintiffs were trying to force a federal court to overstep its bounds and halt the policy as it is being debated by federal lawmakers.
The U.S. House voted in May to repeal the policy, and the Senate is expected to address the issue this year.
The case moved forward slowly at first because it was assigned to a judge who had health problems and later retired, Woods said. In late 2008, it was reassigned to Phillips and went to trial in Riverside, Calif., in July.
The ruling is the second major court ruling this summer in which a California judge handed a major victory to gay rights advocates.
In August, U.S. District Judge Vaughn Walker overturned Proposition 8, the ballot proposition that banned gay marriage in California. His ruling is on hold pending appeal.
Six military officers who were discharged under the policy testified during the "don't ask, don't tell" trial. A decorated Air Force officer testified that he was let go after his peers snooped through his personal e-mail in Iraq.
The officers who participated in the trial were "reacting emotionally because they're so proud that they were able to play a part in making this happen," Woods said after the ruling.
"It'll be an interesting decision for our president to decide whether to appeal this case. He's said that 'don't ask, don't tell' weakens national security, and now it's been declared unconstitutional," he said. "If he does appeal, we're going to fight like heck."
The "don't ask, don't tell" policy prohibits the military from asking about the sexual orientation of service members. Under the 1993 policy, service men and women who acknowledge being gay or are discovered engaging in homosexual activity, even in the privacy of their own homes off base, are subject to discharge.
Associated Press writers Pauline Jelinek and Pete Yost in Washington contributed to this report.