A black man who assumed a "shooting stance" and was killed by El Cajon cops in California on Tuesday was supposed to be deported -- twice -- for criminal convictions, according to court documents.

Alfred Olango, 38, a Ugandan refugee, had twice been ordered by an immigration judge to be deported due to criminal convictions, but remained in the United States after Uganda refused to accept him, reported the Washington Post.

Olango came to the U.S. in 1991. According to court documents, Olango and his family fled Uganda because they feared becoming victims of political violence.

He was ordered to be deported in 2002 after being convicted for transporting and selling drugs, said the Post, and the 2002 order was renewed in 2009 after Olango finished serving a sentence for a felony he committed while in possession of a firearm.

In both cases, Uganda refused to give Olango travel documents that would have enabled him to return to his homeland, according to U.S. Immigration and Customs Enforcement.

After Olango was denied travel documents, the immigration system was forced to release him after six months based on a U.S. Supreme Court ruling that prohibits immigrants to be held in custody if in fact their native country refuses to allow them to return.

“The officers knew they were not going to be able to hold this guy,” said John Sandweg, a former ICE director.

According to Fox News, Olango was shot and killed by police after pulling a vapor smoking device from his pocket and pointing it at the police officer who fired, all while another officer tried to subdue him with a stun gun.

The incident was caught on video by a bystander, and police have defended their position by placing a focus on the fact that Olango was in a “shooting stance” when shot and killed, Fox News noted.

#BREAKING: Multiple attempts by the U.S. to deport the man shot by El Cajon Police. Uganda said no. @CBS8 pic.twitter.com/4BzeRHdFK0 — Barbara Richards (@sdbrichards) September 29, 2016

According to CBS8, Olango was wandering into traffic when police showed up at a shopping center in the San Diego suburb.

On Wednesday there were reports that Olango was having an emotional breakdown while mourning his best friend’s death.