A flight nurse sacked under Don’t Ask, Don’t Tell should be reinstated, a federal judge has ruled.

Former Major Margaret Witt was sacked in 2007 after 19 years of service in the Air Force and Air Force Reserves.

She kept her sexuality secret but was outed in 2004 when the ex-husband of her girlfriend informed the Air Force that she was gay.

She took her case to a federal court in Tacoma, Washington, to sue for her old job and won last Friday.

In the ruling, US District Court Judge Ronald Leighton wrote: “The reinstatement of Maj. Margaret Witt will not erode the proficiency of the United States military.

“The men and women of the United States military have over the years demonstrated the ability to accept diverse peoples into their ranks and to treat them with the respect necessary to accomplish the mission, whatever that mission might be.

“That ability has persistently allowed the armed forces of the United States to be the most professional, dedicated and effective military in the world.”

Under the law, gay and lesbian soldiers must keep their sexual orientation secret or risk dismissal. This is the first time a US federal judge has ordered the military to accept an out gay soldier.

Judge Leighton added: “Her discharge from the Air Force Reserves violated her substantive due process rights under the Fifth Amendment to the United States Constitution. She should be restored to her position as a flight nurse.”

Major Witt was represented by the American Civil Liberties Union.

Kathleen Taylor, executive director of the ACLU of Washington, said: “Today we heard the hammer of justice strike for Major Margaret Witt.

“We look forward to the day when all members of our military can serve our country without invidious discrimination. To discharge Major Witt simply because of her sexual orientation was entirely unfair to her and unwise for the military, which needs her significant skills.”

Last week, Republican senators blocked a bill to repeal the controversial law. President Obama has promised to end the ban and a Pentagon review of the policy is underway.