BELFAST (Reuters) - Belfast's High Court ruled on Monday that parts of the United Kingdom's flagship immigration policy should not apply in Northern Ireland as they undermine human rights protections guaranteed in post-Brexit arrangements.

The Illegal Migration Act, passed last year, means those who arrive in the UK illegally are prevented from claiming asylum, instead facing removal either to their home country or a so-called safe third country like Rwanda.

Judge Michael Humphreys found various aspects of the law, including the removal of asylum seekers, children and victims of human trafficking without any assessment being carried out, were unlawful in Northern Ireland.

Lawyer Sinead Marmion, who represented one of the applicants, a 16-year-old asylum seeker from Iran who travelled to the UK by boat last year, said the ruling would prevent the government from removing such people from Northern Ireland.

British Prime Minister Rishi Sunak said his government would take all steps to defend its position, including through appeal.

"I have been consistently clear that the commitments in the Belfast (Good Friday) Agreement should be interpreted as they were always intended, and not expanded to cover issues like illegal migration," Sunak said in a statement.

The applicants, which also included the Northern Ireland Human Rights Commission, argued that key parts of the law were incompatible with the post-Brexit Windsor Framework jointly agreed last year by London and Brussels.

The agreement guaranteed that there would be no diminution of human rights protected under Northern Ireland's 1998 Good Friday peace agreement following Britain's withdrawal from the European Union.

The immigration legislation is at the heart of Sunak's pledge to stop asylum seekers from making the dangerous crossing from France to the southern coast of England on small, often unseaworthy boats.

(Reporting by Amanda Ferguson, writing by Padraic Halpin; Editing by Kate Holton and Hugh Lawson)