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.

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.

In her ruling, Phillips said the policy doesn’t help military readiness and instead has a “direct and deleterious effect” on the armed services by hurting recruiting during wartime and requiring the discharge of service members with critical skills and training.

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.

“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 ousted since 1994, the group says.

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.

The U.S. Department of Justice can file an appeal, but there was no immediate word of that. After-hours e-mails and calls requesting comment from government attorney Paul G. Freeborne and from the Pentagon were not immediately returned Thursday evening.

Other government lawyers said the judge lacked the authority to issue a nationwide injunction.

The lawsuit was the biggest legal test of the law in recent years and came amid promises by President Obama that he will work to repeal the policy.

The ruling is the second major court decision this summer to come from a California judge and hand a major victory to gay rights advocates.

In August, U.S. District Court Judge Vaughn Walker overturned Proposition 8, the ballot proposition that banned gay marriage in California. His ruling is on hold pending appeal.