The US government wanted to deport him, arguing his activism was detrimental to its foreign policy interests.
But in late June, after spending more than 100 days in immigration detention a federal judge ruled that Mr Khalil was not a flight risk or threat to his community and could be released.
Mahmoud Khalil sat down with our North America correspondent Nomia Iqbal.