The Obama administration objected Thursday to immediately ending the military's ban on openly gay service members, saying that an injunction to stop the "don't ask, don't tell" policy might harm military readiness at a time of war.

In a filing with a federal court in California, the Justice Department said that a judge who struck down the policy as unconstitutional should not enforce that ruling with a military-wide injunction banning the discharge of gay service members.

"A court should not compel the Executive to implement an immediate cessation . . . without regard for any effect such an abrupt change might have on the military's operations, particularly at a time when the military is engaged in combat operations and other demanding military activities around the globe," government lawyers said in their filing.

U.S. District Judge Virginia A. Phillips ruled this month that "don't ask, don't tell" is unconstitutional and has a "direct and deleterious effect" on the armed services. The ruling came after a trial in which the Justice Department defended the law, even though President Obama supports a repeal of "don't ask, don't tell." The policy forbids the military from asking about a service member's sexual orientation but retains a ban on gays serving openly.

The case was brought by the Log Cabin Republicans, a 19,000-member group that includes current and former military members. Phillips asked the group to suggest language for an injunction, and it urged the judge to ban enforcement throughout the military of "don't ask, don't tell."

The Justice Department, in its response, said any injunction should be limited to members of the Log Cabin Republicans. Noting that Congress and the administration "are actively examining" the issue, it urged the judge to wait until the Pentagon completes a study on how to integrate gay men and lesbians into the ranks.

The Senate considered this week whether to repeal the policy now, rather than waiting for the study, but a bill that contained the proposal stalled as Republicans united against it.

Gay rights groups expressed dismay at the legal filing. "We are extremely disappointed with the Obama administration,'' said Log Cabin Republicans executive director R. Clarke Cooper. "Many times on the campaign trail, President Obama said he would support the repeal of 'don't ask, don't tell.' Now that it's time to step up to the plate, he isn't even in the ballpark."

Staff reporters Robert Barnes and Ed O'Keefe contributed to this report.