Britain’s High Court ruled Monday that the government’s controversial plan to send asylum seekers to Rwanda is legal.

The British government has reached an agreement with Rwanda that would deport migrants who arrived in Britain illegally on a one-way trip to Rwanda, a country with a questionable human rights record, to have their asylum claims processed.

Under Britain’s agreement with Rwanda, applicants granted asylum would be eligible to remain in Rwanda but would not be eligible to return to Britain.

Britain had to cancel the first flight to Rwanda in June after the European Court of Human Right blocked the move, saying that the plan carried “a real risk of irreversible harm.”

Human rights groups say Britain’s pact with Rwanda is inhumane and the African nation does not the capacity to process the claims.

Politicians say the plan would deter the influx of migrants into Britain.

More than 40,000 migrants have crossed the English Channel to arrive on Britain’s shores this year. Last week, four people died on their trip from France when their dinghy capsized in freezing weather.