Australia's highest court ordered the government on Wednesday to allow a Pakistani refugee to make Australia his home, ruling he could not be refused a visa simply because he arrived by boat.

The unanimous decision of the High Court's six judges was a blow to the government's contentious policy of refusing to allow any asylum seekers who arrive in people smugglers' boats to ever settle in Australia.

The Pakistani, who cannot be named, arrived at the Australian Indian Ocean territory of Christmas Island in 2012. Australia runs an immigration detention camp on the island for boat arrivals instead of bringing them to the Australian mainland.

He won a High Court battle last year to force the then Immigration Minister Scott Morrison to reconsider his decision to refuse him a protection visa against the advice of a government tribunal that the man was a genuine refugee.

Morrison reconsidered his decision, but triggered another court battle by refusing the man's refugee application "in the national interest" because the man had arrived by boat.

The High Court ruled Wednesday that Morrison's refusal was not lawful and ordered the current Immigration Minister Peter Dutton to grant the man a permanent protection visa.

Thousands of asylum seekers from the Middle East and Asia have made long journeys to Australia. The journey often ends in rickety boat trips from Indonesian ports organized by human traffickers.

But the boats have all but stopped since Australia began turning them back to Indonesia or transferring their passengers to detention camps operated by Australia on the impoverished Pacific island nations of Nauru and Papua New Guinea.

The minor Greens party, which opposes the government's refugee policy, applauded the court's decision.

"The minister should have recognized Australia's international obligations and granted this man a protection visa when he was found to be a refugee," Greens Sen. Sarah Hanson-Young said in a statement.