US defence secretary Robert Gates has said that Congress, rather than a court, should lift the ban on out gay soldiers in the military.

Yesterday, a federal judge issued an injunction for an immediate end to the policy but Mr Gates said that this could have “enormous consequences”.

He 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.”

Speaking to reporters on a flight to Brussels, he said the ban should be lifted after the completion of a Pentagon review.

US District Judge Virginia Phillips’ injunction brings the military the closest it has ever been to repealing the controversial law.

Her injunction tells the Pentagon to immediately stop enforcing the 1993 law and orders the Defence Department to halt any current investigation or discharge relating to a soldier’s sexual orientation.

The Justice Department has 60 days to respond to the order, if it wishes to. Although the Obama administration opposes the law, it is understood to be keen for the Pentagon review of the repeal effort to continue.

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.