JERUSALEM (AP) — The Israeli government has acknowledged it cannot expel African migrants against their will and has canceled all pending deportation orders.

In a statement to the Supreme Court on Tuesday, the state says: "It is not possible to implement expulsions to a third country without (migrants') consent."

Some 35,000 African migrants, mostly from Sudan and Eritrea, are in Israel. The government wants most of them to leave, but has not been able to find a way to expel them lawfully.

Last month, Prime Minister Benjamin Netanyahu reached a deal with the U.N. to resettle half of the migrants in Western nations and absorb the rest. But hours later, he called it off, caving in to nationalist critics who said it wasn't enough.