LOS ANGELES -- A federal judge on Thursday declared the U.S. military's ban on openly gay service members unconstitutional and said she will issue an order to stop the government from enforcing the "don't ask, don't tell" policy nationwide.

U.S. District Judge Virginia Phillips said the ban violates the First and Fifth Amendment rights of gays and lesbians. "Don't ask, don't tell" prohibits the military from asking about the sexual orientation of service members but requires discharge of those who acknowledge being gay or are discovered engaging in homosexual activity, even in the privacy of their own homes off base.

In her ruling, Phillips said the policy doesn't help military readiness and instead has a "direct and deleterious effect" on the armed services.

The Log Cabin Republicans, a 19,000-member group that includes current and former military members, filed a lawsuit in 2004 seeking an injunction to stop the ban's enforcement. 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.

After-hours e-mails requesting comment from U.S. Department of Justice attorney Paul G. Freeborne and from the Pentagon were not immediately returned Thursday.

The lawsuit 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.

The Log Cabin Republicans said more than 13,500 service members have been fired since 1994.

"This decision will change the lives of many individuals who only wanted to serve their country bravely," said the group's attorney, Dan Woods.

Woods argued during the nonjury trial 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. Lawyers also submitted remarks by Obama stating "don't ask, don't tell" weakens national security.

Freeborne had 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.

That makes the trial unnecessary, and the testimony and documentary evidence presented by the Log Cabin Republicans irrelevant, Freeborne said.

"We do not believe the court has the authority to issue a nationwide injunction," he said.

Government attorneys presented only the policy's legislative history in their defense and no witnesses or other evidence.

Six military officers who were discharged under the policy testified during the 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."