Immigration Minister Peter Dutton will comply with a High Court order to grant a permanent protection visa to a Pakistani refugee.

In an unusual move, the Chief Justice of the High Court issued an order commanding the Minister to grant the visa.

It was the second time the man had sought help from the High Court.

He arrived at Christmas Island in 2012 and was eventually given refugee status.

But he was originally denied a protection visa due to regulations capping the number of visas granted.

Under the law, once refugee status has been determined, the Immigration Minister has 90 days to issue a protection visa.

Former immigration minister Scott Morrison capped the number of protection visas granted in the financial year after the Senate blocked the Government's re-introduction of temporary protection visas.

However in June 2014, the High Court found the Minister did not have the power to limit the number of visas because of the time limit.

The court ruled the regulations capping visa numbers invalid and ordered the Government to reconsider the man's application.

But when that happened he was again refused a visa by Mr Morrison, as it was deemed not to be "in the national interest" because he was an unauthorised maritime arrival.

The plaintiff challenged the use of the "national interest" test and asked for orders directing the Minister to grant him a visa.

He also alleged that changes made to the Migration Act late last year did not affect his right to a visa.

Today the court unanimously found the decision made by Mr Morrison to refuse the visa was illegal, and ordered the current Minister to grant it.

A spokesman for Immigration Minister Peter Dutton has confirmed the visa will be granted within seven days.

The court found that as an asylum seeker the man was entitled to a visa under the Migration Act, and the Minister could not refuse his application because he was an unauthorised maritime arrival.

It also held that the amendments to the act did not affect the man's right to obtain a permanent protection visa, and that it was not necessary to address the validity of the "national interest" criterion.