JERUSALEM (Reuters) - Israel said on Wednesday it would pay thousands of African migrants living illegally in the country to leave, threatening them with jail if they are caught after the end of March.

Prime Minister Benjamin Netanyahu, in public remarks at a cabinet meeting on the payment program, said a barrier Israel completed in 2013 along its border with Egypt had effectively cut off a stream of “illegal infiltrators” from Africa after some 60,000 crossed the desert frontier.

The vast majority came from Eritrea and Sudan and many said they fled war and persecution as well as economic hardship, but Israel treats them as economic migrants.

The plan launched this week offers African migrants a $3,500 payment from the Israeli government and a free air ticket to return home or go to “third countries”, which rights groups identified as Rwanda and Uganda.

“We have expelled about 20,000 and now the mission is to get the rest out,” Netanyahu said.

An immigration official, speaking on condition of anonymity, said there are some 38,000 migrants living illegally in Israel, and some 1,420 are being held in two detention centers.

“Beyond the end of March, those who leave voluntarily will receive a significantly smaller payment that will shrink even more with time, and enforcement measures will begin,” the official said, referring to incarceration.

Some have lived for years in Israel and work in low-paying jobs that many Israelis shun. Israel has granted asylum to fewer than one percent of those who have applied and has a years-long backlog of applicants.

Rights groups have accused Israel of being slow to process African migrants’ asylum requests as a matter of policy and denying legitimate claims to the status.

Netanyahu has called the migrants’ presence a threat to Israel’s social fabric and Jewish character, and one government minister has referred to them as “a cancer”.

Teklit Michael, a 29-asylum seeker from Eritrea living in Tel Aviv, said in response to the Israeli plan that paying money to other governments to take in Africans was akin to “human trafficking and smuggling”.

“We don’t know what is waiting for us (in Rwanda and Uganda),” he told Reuters by telephone. “They prefer now to stay in prison (in Israel) instead.”

In his remarks, Netanyahu cited the large presence of African migrants in Tel Aviv’s poorer neighborhoods, where he said “veteran residents” - a reference to Israelis - no longer feel safe.

“So today, we are keeping our promise to restore calm, a sense of personal security and law and order to the residents of south Tel Aviv and those in many other neighborhoods,” he said.