(CNN) -- A federal court in California has ruled that the military's "don't ask, don't tell" policy -- which bars gay men and lesbians from serving openly -- is unconstitutional, shifting the focus on the controversial rule to Congress.
The ruling by U.S. District Judge Virginia Phillips, a 1999 Clinton appointee, on Thursday said the policy violates the First and Fifth amendments.
Phillips "affirmed what the vast majority of the American people know to be true: that it's time for the discriminatory 'don't ask, don't tell' law to be sent to the dustbin of history," said Joe Solmonese, president of the Human Rights Campaign, a Washington-based group that lobbies for lesbian, gay, bisexual and transgender equal rights.
The judge is expected to issue her injunction in coming weeks, barring the government from enforcing "don't ask, don't tell."
The next step is expected to be for the government to ask for a temporary injunction to prevent the ruling from going into immediate effect, pending further appeals. The government at some point in the next few weeks or months would then file a petition with the 9th Circuit U.S. Court of Appeals, which is based in San Francisco, for a hearing. If the government were to lose, its next step would be to the Supreme Court.
But since the Pentagon and White House have signaled their intention to end "don't ask, don't tell," with congressional approval, Thursday's ruling may be viewed in a different light.
"With this legal victory in hand, Congress is right now in a perfect position to strengthen our national security by ending a law that has discharged thousands of capable service members," Solmonese said. With House passage already secured, the Senate can and should vote in the next few weeks to repeal 'don't ask, don't tell' and allow every qualified man and woman the chance to serve with honor."
A Justice Department spokesman Friday would only say that the government is reviewing the ruling.
President Obama is pushing for a repeal of the "don't ask, don't tell" policy. A bill that would overturn the measure after a Pentagon review is completed in December is currently before Congress.
More than 12,500 gays have been booted from the military since "don't ask, don't tell" went into effect.
Thursday's 85-page ruling came in a case filed by the group Log Cabin Republicans against the government and Defense Secretary Robert Gates.
"The act discriminates based on the content of the speech being regulated," Phillips wrote. "It distinguishes between speech regarding sexual orientation, and inevitably, family relationships and daily activities, by and about gay and lesbian servicemembers, which is banned, and speech on those subjects by and about heterosexual servicemembers, which is permitted."
But, she noted, "the sweeping reach of the restrictions on speech in the don't ask, don't tell act is far broader than is reasonably necessary to protect the substantial government interest at stake here."
Then, citing examples provided by witnesses, she concluded that "the act's restrictions on speech not only are broader than reasonably necessary to protect the government's substantial interests, but also actually serve to impede military readiness and unit cohesion rather than further these goals."
Servicemembers United, which describes itself as the nation's largest organization of gay and lesbian troops and veterans, hailed the announcement.
"This is an historic moment and an historic ruling for the gay military community and for the readiness and integrity of our armed forces," said Alexander Nicholson, executive director of the group and a former multilingual U.S. Army interrogator who was discharged under "don't ask, don't tell."
"As the only named injured party in this case, I am exceedingly proud to have been able to represent all who have been impacted and had their lives ruined by this blatantly unconstitutional policy. We are finally on our way to vindication."
CNN's Bill Mears contributed to this report.