Maj. Jan Mohammad Arash, who has been detained since September, "was shocked and very happy," according to Matthew Borowski, Arash's attorney.
"(Arash) had lost hope and resigned himself to being deported back to Afghanistan," Borowski told CNN. "He's looking forward to living his life as an American here in the United States."
Arash, along with fellow Afghan National Army officers Capt. Mohammad Nasir Askarzada and Capt. Noorullah Aminyar, were guests of the U.S. military at the annual Exercise Regional Cooperation on Joint Base Cape Cod in Massachusetts in September.
The trio disappeared from the base September 20 after a late night out at a strip club
. Two days later, the Afghan officers were arrested as they attempted to cross the Rainbow Bridge connecting Niagara Falls, New York, to Niagara Falls, Ontario.
All three were charged with administrative violations and placed into removal proceedings, according to U.S. Immigration and Customs Enforcement spokesman Daniel Modricker.
Arash sought asylum but was denied in January on the grounds that the Taliban was neither a government nor run by a government, and thus he was not subject to political asylum laws.
Borowski, a Buffalo-area immigration attorney, took the case to the Board of Immigration Appeals in Virginia, which ruled June 25 that because the Taliban is a resistance group -- and the government is unwilling or unable to control the group -- Arash should be granted asylum.
"Essentially, the judges ruled that even if my client were to give up his uniform, the Taliban would still target him because of the work he did here on American soil," Borowski told CNN.
Arash's case now goes back to the federal judge in the Buffalo area who initially denied his plea for some standard background checks, according to Borowski. Assuming he is able to clear those, Borowski said his client will be granted asylum within a week or two.
Aminyar, who is also fighting deportation from the United States ought to have the outcome of his case influenced by the ruling, according to Borowski. Askarzada was transferred to Canada, but the status of his case was not immediately known.