Tony Blair has expressed dismay after the High Court ruled nine Afghan asylum seekers who hijacked a plane to Britain have won their bid to stay in the UK.
The stand-off at Stansted lasted for four days
Mr Justice Sullivan said the nine could remain until it was safe to return.
The PM said the ruling was an "abuse of common sense" and should be overturned, and he is considering an appeal.
It followed the Afghan hostage drama at Stansted Airport in 2000 which led to a four day stand-off and asylum applications by 78 people on board.
"We can't have a situation in which people who hijack a plane, we're not able to deport back to their country," Mr Blair said.
"It's not an abuse of justice for us to order their deportation, it's an abuse of common sense frankly to be in a position where we can't do this.
To deter hijacking and international terrorism, individuals should not be "rewarded with leave to remain in the UK", the Home Office said.
A spokesman said it had introduced a policy that enabled the secretary of state not to grant leave to people who are "excluded from international protection" and keep them on temporary admission visas.
The question of what should happen to the nine and their families had caused a serious clash between the government and the judiciary over human rights law.
The High Court judge expressed his anger over the way ministers failed to follow correct legal procedures and "deliberately delayed" implementing an adjudication appeal panel's decision from two years ago.
The decision in June 2004 meant that, under human rights law, the nine could not be sent back to Afghanistan where their lives would be at risk.
The judge also made an unprecedented order that the Home Office should pay legal costs on an indemnity basis - the highest level possible - to show his "disquiet and concern".
The nine men were jailed at the Old Bailey in 2001 for hijacking the Ariana Boeing 727 on an internal flight in Afghanistan.
Appeal judges quashed the convictions in May 2003 but insisted that their decision was "not a charter for future hijackers". They said a mistake in directing the jury was the only reason the men's appeal had succeeded.
Successive home secretaries had failed to grant the Afghans discretionary leave to enter the UK.
The nine were only permitted temporary admission, due to fears that to allow them to live and work freely in Britain would amount to "a charter for future hijackers".
However, Mr Justice Sullivan, sitting in London, said: "It is difficult to conceive of a clearer case of 'conspicuous unfairness amounting to an abuse of power'."
The judge went on: "Lest there be any misunderstanding, the issue in this case is not whether the executive should take action to discourage hijacking, but whether the executive should be required to take such action within the law as laid down by Parliament and the courts."
He ordered Home Secretary John Reid to grant the nine "discretionary leave" to remain in the UK, subject to review every six months.
Lawyers for the family said the decision means, subject to any appeal, that the nine and their families will now be able to take up employment and "get on with their lives".
Following the ruling, the Home Office said: "The hijackers are not deemed to present a threat to the UK's national security at present and it remains our intention to remove them as soon as it is possible to ensure that they can be returned in safety to Afghanistan."