A federal judge in Riverside on Thursday declared the U.S. military’s ban on openly gay service members unconstitutional, saying the “don’t ask, don’t tell” policy violates the 1st Amendment and due process rights of lesbians and gay men.

U.S. District Judge Virginia A. Phillips said the policy does not preserve military readiness, contrary to what Justice Department attorneys and many supporters have argued, because evidence shows that the policy in fact has had a “direct and deleterious effect” on the armed services.

Phillips said she would issue an injunction barring the government from enforcing the policy. However, the Justice Department, which defended “don’t ask, don’t tell” during a two-week trial in Riverside, will have an opportunity to appeal that decision.

Thursday’s ruling came in a case filed in 2004 by the Log Cabin Republicans, the largest gay GOP political organization. It is the first successful legal challenge to the policy since Congress enacted it in 1993.

In her 85-page ruling, Phillips offered a scathing critique of the ban on gays serving openly. She noted that the military has since permitted more convicted felons to enlist and that both President Obama and the chairman of the Joint Chiefs of Staff have called for the repeal of “don’t ask, don’t tell.”

The judge found convincing evidence that the military’s own actions showed that having gays and lesbians in the service did nothing to impede military capabilities. The branches have routinely delayed discharging service members suspected of violating the policy until they have completed their deployments in Iraq and Afghanistan, and the number of discharges has declined significantly since the start of the Afghanistan war in 2001.

Phillips said the evidence showed that the “don’t ask, don’t tell” policy had harmed military capabilities. The policy has hindered recruiting efforts, led to the discharge of service members the military considers “critical” — including medical professionals and Arabic and Persian linguists — and has caused the military to enlist recruits who earlier would have been rejected because of their criminal records or lack of education or because they were out of shape, she said.

The policy also violates the right to free speech because heterosexual service members are free to state their sexual orientation, while homosexuals face discharge if they do the same, she said.

The ruling comes just over a month after a federal judge in San Francisco tossed out California’s voter-approved ban on same-sex marriage, providing back-to-back victories for gay rights advocates seeking policy changes in the courts that have eluded them in Congress and at the ballot box.

“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,” said R. Clarke Cooper, executive director of the Log Cabin Republicans. “Today, the ruling is not just a win for Log Cabin Republican service members, but all American service members.”

Justice Department officials did not provide a response to the ruling Thursday.

Former President Clinton, who nominated Phillips to the federal bench in 1999, adopted the “don’t ask, don’t tell” policy in 1993 as a reform to the military’s practice of seeking out and discharging gays and lesbians. Under the policy, as long as gays and lesbians keep their sexual orientation secret, they are allowed to serve.

More than 13,000 service members have been discharged under the policy.

Phillips’ ruling is expected to intensify political pressure in Washington to act on legislation to repeal “don’t ask, don’t tell” that remains stalled in the Senate despite support from Obama and the Democratic congressional leadership.

“I think it’s a very, very interesting and sound opinion, and I think it will place a lot of pressure on Congress to move on this issue,” said constitutional scholar Kenji Yoshino of the New York University School of Law. “From a gay rights perspective, it’s a very exciting development.”

Yoshino predicted the case would be appealed all the way to the Supreme Court if Congress fails to act.

Obama has called the ban a threat to national security, and the House of Representatives in May passed legislation to repeal “don’t ask, don’t tell” if an ongoing Pentagon study determines that the military can adapt to the change without harming defense readiness.

Despite Obama’s criticism of the policy, the Justice Department vigorously defended it.

During the trial, Justice Department attorney Paul G. Freeborne argued that Congress — not a federal court — should have the authority and the responsibility to enact military policy.

The sole evidence presented by the Justice Department was the legislative history of the ban, which federal government lawyers argued showed the policy was properly adopted by Congress though a deliberative and reasoned political process. No witnesses were called.

Conversely, attorneys for Log Cabin Republicans called to the stand several decorated military officers discharged for their sexual orientation, including Air Force Maj. Michael Almy. Almy, deployed three times to Iraq, said his commanding officer attempted to force him to admit he was a homosexual after another service member, without permission, searched Almy’s private e-mail and found a message discussing homosexual conduct. After fighting his dismissal for 16 months, he agreed to accept an honorable discharge.

“Now, with this ruling, all Americans will be able to serve in our country’s armed forces without regard to their sexual orientation. This is an extremely important precedent,” said Dan Woods, a Los Angeles-based attorney at the White & Case law firm representing the Log Cabin Republicans.

Woods said he would vigorously fight any attempt to stay the judge’s injunction barring enforcement of the policy.

“If there was a stay, homosexuals would be denied their constitutional rights while they are fighting and dying for our country,” he said.

phil.willon@latimes.com