US president Barack Obama promised yesterday that he would end Don’t Ask, Don’t Tell.

At the same time, his administration filed an application to stay a court judgment ordering an immediate end to the policy.

US District Judge Virginia Phillips, of California, issued an injunction on Tuesday which ordered the Pentagon to halt sackings of out gay soldiers.

The Justice Department, on behalf of the government, asked her to respond by Monday and said the military would be harmed if the current ban was not allowed to stay in place temporarily.

If Judge Phillips does not stay her order, the application added, the government will ask the 9th US Circuit Court of Appeals in San Francisco to block her ruling.

In another development, it has emerged that the Pentagon has issued guidance to troop commanders to comply with Judge Phillips’ order.

President Obama has been accused of “flip-flopping” on his commitment to end the ban by gay groups.

He said yesterday: “Anybody should be able to serve, and they shouldn’t have to lie about who they are in order to serve.

“But this isn’t a question about whether the policy will end. This policy will end, and it will end on my watch.”

However, he favours repeal through Congress rather than the courts.

On Wednesday, defence secretary Robert Gates said: “I feel strongly this is an action that needs to be taken by the Congress and that it is an action that requires careful preparation, and a lot of training.

“It has enormous consequences for our troops.”

The Department of Defence has confirmed that sackings and investigations of out gay soldiers are being suspended.

A spokesman said: “The Department of Defence will of course obey the law, and . . . in the meantime, the department will abide by the terms in the court’s ruling, effective as of the time and date of the ruling.”

An estimated 13,500 soldiers have been dismissed under the law, which allows gay and lesbian soldiers to serve in the military but bars them from revealing they are gay. In many cases, dismissed soldiers had their sexual orientation revealed by a third party.

Opponents to repealing the law say it will harm recruitment, cohesion and morale at a time when the military is fighting in Iraq and Afghanistan.