The United States Department of Homeland Security was ordered Monday in San Francisco to bring back a man they deported.
A federal judge ruled the government did not properly consider the man's claim that he could be thrown in prison in his home country because he is gay.
Initially, the man petitioned to stay because of political persecution. But when he lost the case, he appealed on the grounds that he is gay, which could land him in prison for two years in Chad.
Oumar Yaide had been in San Francisco for nearly a decade when he was arrested. His appeal is on the grounds that his home country has outlawed gay sex was pending when Immigration and Customs Enforcement agents took him to the airport.
Edwin Carmona-Cruz, a paralegal working on Yaide's case, said his office went to Federal Judge Charles Breyer, who ordered the government to bring Yaide back because they had violated his right to a hearing.
"When I first found out he was deported, I burst into tears," friend Hayley Kay said. "When I found out he was coming back, I burst into tears, but it was happy tears."
Friends have raised nearly $14,000 to help Yaide with expenses in Chad and when he returns to San Francisco.
The twist now is Yaide cannot leave Chad without a passport -- his current passport is now expired.
NBC Bay Area reached out to ICE, but no one has been made available to comment.
Judge Breyer initially gave the government two weeks to bring Yaide back, but when Homeland Security said that was too short a time frame he lifted the two-week deadline and called them back to report to him on Wednesday.