JERUSALEM -- In a controversial move decried by human rights organizations, Israel's parliament passed a bill allowing migrants to be jailed without trial for a year. Under the law finalized early Tuesday after a heated late-night debate, Israeli authorities will be able to jail new migrants for a year if they slip over the border illegally, and detain others already in Israel in a new holding facility indefinitely. The law was intended to apply almost exclusively to African migrants who cross the border in uncontrolled stretches of open desert. In the past, most have come in from Egypt. It replaces a previous law, ruled unconstitutional by the Supreme Court, that allowed migrants to be jailed for three years. The court ruled in September that the law violated human rights. The new law attempted to address the court's concerns by lowering the detention time. The court had also ordered the government to release about 2,000 Africans detained at the time, and review individual requests for asylum and refugee recognition. Fewer than half have been released. Passing the new law "reflects poorly on Israel's human rights record," said Sara Robinson of Amnesty International Israel. Referring to the new detention facility, Robinson said that detaining refugees and asylum seekers indefinitely in what is "essentially a prison in the desert" is a "flagrant violation of international human rights law." The new "open" facility will hold about 3,000 detainees and provide services to discourage them from working. Technically, they will be free to come and go during daytime but must return to the remotely located center by night. The government refers to the migrants as "infiltrators" because they enter the country without passing through controlled border crossings. Many of the migrants are asylum seekers, but very few are granted asylum out of thousands of requests reviewed annually by a Refugee Status Determination committee. "Work is the main motive for their arrival," Interior Minister Gideon Saar said. An influx of migrants from Africa over the last decade left Israel grappling for a response. While the recently completed fence along the country's border with Egypt is blocking new arrivals, an estimated 50,000 asylum seekers and undocumented migrants from African countries live in Israel. Most migrants come from Eritrea and Sudan, and Israel cannot deport them under international law. The government is negotiating with different African countries to resettle its unwanted asylum seekers and a few thousand have left the country in a process that Israeli authorities call voluntary. Obama pays tribute to Nelson Mandela as a 'great soul'