The Australian man who was locked up in a US federal detention centre for overstaying his visa by just 90 minutes, has been released from custody after more than two weeks.
Baxter Reid was taken to the Batavia Detention Center in Buffalo, New York, after being stopped on the US-Canadian border on April 23.
The 26-year-old from Canberra made headlines around the world and led to an online GoFundMe campaign that raised more than $US10,000 ($14,622) for his legal defence.
"He was very happy," Reid's lawyer Julie Kruger told AAP as she described his reaction in court on Wednesday when a judge announced he would be freed.
Reid crossed into Canada with his American girlfriend, Heather Kancso, just before his US visa expired at midnight on April 23.
But Canadian border authorities held him and then sent him back to the US about 1.30am even though his visa was no longer being valid.
US authorities took Reid into custody and charged him with overstaying his lawful status in the US.
Kruger said Department of Homeland Security officials had agreed to move his next court appearance up to Wednesday.
Reid had no criminal background or history of violating US immigration laws and told the court he was keen to return to Australia.
In a big court win for the Australian, the judge gave him 120 days to leave the US on his own accord rather than being deported under guard.
He will not be prevented from returning to the US.
"It is a great result because a deportation order would be a 10-year bar to coming back to the US so he won't have that and he did not overstay his status to accrue unlawful presence," Kruger said.
"If you overstay your status by more than six months then you are barred for three years from coming back or if you overstay by more than one year you are barred for 10 years.
"Because he was only 90 minutes he is not barred for that reason. He is able to come back into the US as a visitor."