“We are not surprised by the government’s action, as it repeats the broken promises and empty words from President Obama avowing to end ‘don’t ask, don’t tell’ while at the same directing his Justice Department to defend this unconstitutional policy,” said Dan Woods, a lawyer representing the group. “Now that the government has filed a request for a stay, we will oppose it vigorously because brave, patriotic gays and lesbians are serving in our armed forces to fight for all of our constitutional rights while the government is denying them theirs.”

Mr. Obama campaigned against the “don’t ask, don’t tell” law and has asked Congress to repeal it. But his efforts have been criticized by supporters of equal rights for gay men and lesbians as too slow and insufficient, and the lawsuit has put his administration in an awkward political position.

At a town-hall-style meeting with young adults on Thursday, Mr. Obama noted that he had been working on getting the law repealed and that a court had recently struck it down as unconstitutional, although he did not specifically address his administration’s appeal of the ruling.

“I agree with the basic principle that anybody who wants to serve in our armed forces and make sacrifices on our behalf, on behalf of our national security — anybody should be able to serve, and they shouldn’t have to lie about who they are in order to serve. And so we are moving in the direction of ending this policy,” he said.

But, he added: “It has to be done in a way that is orderly, because we are involved in a war right now. But this is not a question of whether the policy will end. This policy will end, and it will end on my watch. But I do have an obligation to make sure that I’m following some of the rules. I can’t simply ignore laws that are out there. I’ve got to work to make sure that they are changed.”