Two men with links to outlaw motorcycle gangs and long criminal records have won a last-minute court bid to stay in Australia.
The Full Court of the Federal Court on Monday overturned a decision by Immigration Minister Peter Dutton to deport the two men.
The three judges ordered the two men - Tomasi Taulahi and Helder Agapito Carrascalao - be immediately released from immigration detention and Mr Dutton to pay their legal costs.
Immigration Minister Peter Dutton (pictured) decision to deport the men has been overturned
The judgment set aside Mr Dutton's decision to cancel the men's visas on December 16 last year.
Mr Taulahi and Mr Carrascalao claimed Mr Dutton had not spent enough time considering their cases before making his decision and the judges agreed.
They said Mr Taulahi was a Tongan citizen who first arrived in Australia in December 1988 and had held a series of visas since then.
Mr Taulahi, whose wife and two young daughters are Australian citizens, had run a successful earthmoving business employing about 20 people before being arrested and taken into immigration detention.
His criminal history began with a conviction for malicious damage in 1993, when he was 16.
He was also convicted as a minor for offences including assault, resisting police, and breaking, entering and theft.
His first offence as an adult was cocaine possession in 1997.
But the main reason Mr Dutton decided to cancel Mr Taulahi's visa in the national interest was because he did not pass the character test given his association with the Lone Wolf bikie gang.
Two men with criminal records have won a last-minute court bid to stay on in Australia
The three judges said father of two Mr Carrascalao, who was born in East Timor and is a Portuguese citizen.
Mr Carrascalao was granted an entry permit in 1976 to remain permanently in Australia with his mother and seven siblings.
The judges said Mr Carrascalao's criminal history dated back to when he was found guilty of stealing at age 13 but no conviction was recorded.
His record includes convictions in May 2007 for common assault, contravening an apprehended domestic violence order and driving while disqualified.
Mr Dutton's decision to cancel Mr Carrascalao's visa was based on his assault conviction in 2007 and his past involvement with the Bandidos bikie gang.
The three judges said this was despite Mr Carrascalao claiming he was no longer associated with the bikie gang.