The Pentagon announced Thursday that it will comply with a court order to stop enforcing its "don't ask, don't tell" policy barring gays from serving openly in the military, even as the Obama administration asked a federal judge to delay implementation of the ruling.

Officials say they need time to institute new policies to ensure that the change won't affect combat readiness or morale. The administration has said it will appeal the ruling to the the U.S. Court of Appeals for the 9th Circuit.

In the meantime, "the Department of Defense will of course obey the law," Col. Dave Lapan, a department spokesman, said in an e-mail to reporters. The Pentagon will cease investigations and discharges of service members found to be in violation of the policy, officials said.

Despite the Pentagon's announcement, the Servicemembers Legal Defense Fund, a group that supports ending the ban, has encouraged gay military members not to disclose their sexual orientation.

"It is clear there is confusion, and this interim period is dangerous for service members," Executive Director Aubrey Sarvis said in a statement. "Our service members need finality."

In September, District Judge Virginia A. Phillips ruled that the 17-year-old policy violates due process and the First Amendment rights of gay service members. Rather than being necessary for military readiness, she said, the policy has a "direct and deleterious effect" on the armed forces. On Tuesday, she ordered the military to comply immediately with her ruling.

The case was brought by the Log Cabin Republicans, a 19,000-member gay advocacy group that includes current and former military members. The group argued during a two-week trial in July that the policy is unconstitutional and should be struck down. Lawyers for the group plan to respond to the government's application for a stay within 24 hours, a spokeswoman said.

The case is one of two related to "don't ask, don't tell" that have been deliberated this year in federal court. Last month, a judge in Washington state ordered the reinstatement of a decorated Air Force officer who was dismissed for revealing that she is a lesbian.

The administration's decision Thursday to ask for a stay of Phillips's court order was criticized by gay rights groups, which have been frustrated by government inaction on the policy. While running for president, Obama said he would repeal the law. But in September, Senate Democrats were unable to muster the 60 votes needed to begin debate.

"Today's appeal by President Obama's Department of Justice is not only indefensible - it is yet another shocking lack of leadership from the White House on issues of equality for the LGBT community," said Robin McGehee, director of GetEqual, an advocacy group.

Groups also criticized the administration for appealing a decision by a federal judge in Massachusetts that invalidated the Defense of Marriage Act, which bars the federal government from recognizing legal same-sex marriages.

According to recent Washington Post polls, 75 percent of respondents said they think gays should be allowed to serve openly in the military, and nearly half think they should be allowed to legally wed.