A US federal court has dismissed a ruling which struck down the ban on openly gay troops as unconstitutional.

The law was formally repealed last week but some gay rights campaigners said it could be revived in future if further action is not taken.

Republican gay group Log Cabin Republicans sought to have it declared as unconstitutional and a lower court agreed.

The group added that having the law declared unconstitutional could allow troops fired under the 18-year-old law to claim back pay, reinstatement or a change in discharge status.

But the 9th US Circuit Court of Appeals said the previous ruling must be vacated as moot, as the law has been repealed.

The three-judge panel, which voted unanimously, wrote: “Those now-void legal rulings and factual findings have no precedential, preclusive, or binding effect.”

The Department of Justice had contested the case.

R Clarke Cooper, the executive director of Log Cabin Republicans, said: “This decision by the Ninth Circuit denies more than 14,000 discharged gay and lesbian servicemembers an important means of obtaining justice for the wrong perpetuated against them under the ban, and leaves open the possibility of future violations of servicemembers’ rights.

“The court can vacate this ruling, but that does not change the fact that ‘Don’t Ask, Don’t Tell’ was unconstitutional.”

A number of Republican presidential candidates, including Michele Bachmann and Rick Santorum, have said they would reinstate the ban.