The U.S. Air Force has agreed not to discharge Lt. Col. Victor Fehrenbach under “Don't Ask, Don't Tell” while a pending lawsuit is heard.

The 40-year-old officer asked a federal court in Idaho last week to block the Air Force from discharging him under the 1993 law that prohibits gay troops from serving openly.

“The agreement recognizes the immediate harm to Lt. Col. Fehrenbach and insures that he will eventually get to make his case at a full blown hearing without losing his job,” Aubrey Sarvis, executive director of the gay rights group Servicemembers Legal Defense Network (SLDN), which is advising Fehrenbach, said. “This agreement is a victory for Lt. Col. Fehrenbach and our nation.”

Fehrenbach has been under investigation since 2008, when a civilian man accused him of sexual assault.

The military quickly placed him on desk duty at Mountain Home Air Force Base in Idaho as the investigation continued. In a statement to Boise police officers, the 40-year-old officer acknowledged he had sex with his accuser but said it was consensual. Within three weeks, Fehrenbach was cleared of the sexual assault allegation. But the Air Force continued to investigate whether to discharge the highly-decorated flight officer for violating “Don't Ask.”

SLDN said that it acted because a recent Air Force Personnel Board recommendation to Air Force Secretary Michael B. Donley indicated the discharge was imminent. The board only moves a case up to the secretary when recommending separation.

Under new regulations put in place by Secretary of Defense Robert Gates, third party outings are placed under greater scrutiny, but that policy has yet to be tested.

“The Air Force can still do the right thing and retain Lt. Col. Fehrenbach under the Pentagon’s own revised regulations on ‘Don’t Ask, Don’t Tell,'” Sarvis added.

Fehrenbach is 13 months from a 20-year retirement. If discharged, he would lose his right to a pension, according to documents filed with the court.

“He flew the longest combat sorties in his squadron's history, destroying Taliban and Al Qaeda targets in support of Operation Enduring Freedom and Operation Iraqi Freedom. And after the Sept. 11th attacks, Fehrenbach was hand-picked to protect the airspace over Washington, D.C.” the documents say.

The case relies heavily on the 2008 Witt vs. Department of the Air Force ruling, which found that discharging troops for their sexuality was unconstitutional unless the military could show an overriding government interest. The Witt ruling only applies to the Ninth Circuit, which includes Idaho.

The House of Representatives voted in May to repeal the policy, and the Senate is expected to debate the issue in September. However, Republicans, led by Arizona Senator John McCain, have said they'll fight against repeal.