Israel will release about 200 jailed African migrants in the absence of a final deal to deport them and thousands more Eritrean and Sudanese men who entered the country illegally, the Interior Ministry said on Sunday .

The government has been trying to finalise an agreement with Uganda to take in the migrants, who came into Israel on foot through the Egyptian border over the past decade.

Most of the 200 men set for release were sent to a desert prison in recent months to await deportation to Uganda.

But with negotiations continuing over a deal with Uganda, Israel’s Interior Ministry which has faced court challenges by rights groups over the detentions issued a statement on Sunday saying it would begin releasing the migrants.

The Israeli government says the 37,000 migrants in Israel are job seekers and that it has every right to protect its borders. The migrants and rights groups say they are seeking asylum and are fleeing war and persecution.