Updated

At a time when President Barack Obama is trying to rally his political base, his administration is fighting to temporarily preserve the ban on gays serving openly in the military, even though his core supporters want it ended now.

The Justice Department is appealing a court ruling that would stop the Clinton-era "don't ask, don't tell" policy even as Democrats fighting hard to hold their majorities in Congress are looking to motivate the voters who delivered the White House to this president.

The appeal, although expected, will do little to help Democrats trying to inspire those voters and hold back a Republican tide on Nov. 2.

As the Justice Department sought a temporary delay in the court order, pending an appeal, the president vowed in a meeting with young adults Thursday, "This policy will end and it will end on my watch."

But he cast himself as constrained by the legal process.

"I can't simply ignore laws that are out there," he said. "I have got to work to make sure that they are changed."

Some liberal and gay rights groups had hoped the Justice Department would forgo an appeal and let stand the ruling, which ordered the military to stop enforcing the 17-year-old policy. The Obama administration, looking at a more deliberate pace for a rollback, asked the judge to keep the ban in place until an appeals court can deal with the case.

"It is certainly disappointing and frustrating that the administration has sought a stay," said Joe Solmonese, president of the gay rights group Human Rights Campaign. "There is one simple way to put the endless legal wrangling behind us and do what the president and the American people want to strengthen our military: The administration and Congress need to finish the legislative work on 'don't ask, don't tell' repeal after the election."

The House has passed legislation repealing "don't ask, don't tell," but it has not yet seen a vote in the Senate, where Democrats don't have the votes to overcome a Republican filibuster. Activists have pushed the Senate to take up a vote when it returns after the election for a lame-duck session.

"Given the uncertainty in the courts, we urge the Senate to act swiftly next month on repeal when they return to Washington," said Aubrey Sarvis, head of the Servicemembers Legal Defense Network that provides counsel to gay and lesbian military members. "Congress made this law over 17 years ago and Congress now has an affirmative responsibility to bring clarity and finality to ending this law."

"It is clear there is confusion and this interim period is dangerous for service members," Sarvis said. "Our service members need finality. The president needs to deliver on his promise to end the law this year."

The government's court filing came two days after U.S. District Judge Virginia Phillips in Riverside ordered the Pentagon to cease enforcement of the law approved by Congress in 1993. The law forbids the military from asking about a service member's sexual orientation while also prohibiting gays from disclosing their status.

Allowing the judge's ruling to go forward immediately "will irreparably harm the public interest in a strong and effective military," the government's court papers stated.

Repeated and sudden changes in policy would be "enormously disruptive and time-consuming, particularly at a time when this nation is involved in combat operations overseas," the filing said.

The Pentagon, meanwhile, is in the midst of a study of how it would implement a repeal should Congress act. Leaders of that effort say a hasty pace and inadequate protections for gay and lesbian military members could be a disaster.

That panel's recommendations are expected in December.

(This version corrects that Judge Phillips is in Riverside, Calif., not San Diego.)