Israel should be recognized as an example of a nation that has not forgotten its prime directive of protecting its people and territory. It has a fine robust fence system designed to keep bad guys out and a realistic attitude of distrust toward foreign grifters.

Unlike America, Israel never forgets that it has enemies. It even has an effective airport screening system based on profiling and behavior.

Below, African asylum seekers protested Israel’s policies earlier this year.

The latest proof of effectiveness is the complaints of a human rights group that Israel deported thousands of Africans and a handful may have been questioned at home. A couple might have been treated badly in Sudan (97% Muslim), where visiting Israel is a crime.

Still, they keep coming — 60,000 Africans since 2005 and Israel is a small country, slightly larger than New Jersey.

When thousands of hostile moochers show up on a nation’s doorstep and expect the red carpet, why should any country treat such people as well as citizens when there are millions more where the foreigners came from?

JERUSALEM — Thousands of Sudanese migrants to Israel and hundreds of Eritreans have returned to their home countries this year as a result of an Israeli policy that amounts to “unlawful coercion,” Human Rights Watch said on Tuesday. The group said the migrants had been left few other options even though they were at risk of imprisonment or abuse at the hands of repressive governments back home, and despite protections Israel is obligated to provide under international treaties.

The New York-based human rights group said in a lengthy report that it had documented seven cases in which citizens of Sudan were detained and interrogated in the capital, Khartoum, on their return.

While four of the seven were released after short periods, the report said, one was tortured, a second was put in solitary confinement and a third was charged with treason for visiting Israel, which does not maintain diplomatic relations with Sudan. The group said that under Sudanese law it is a crime to visit Israel, punishable by up to 10 years in prison, and that at least 6,400 Sudanese had returned between January 2013 and the end of June 2014.

The report also said 367 Eritreans had returned home after reaching Israel, but neither Human Rights Watch nor the representative of the United Nations high commissioner for refugees in Israel had any confirmed information about them.

Human Rights Watch said the decision by asylum seekers to leave Israel could not be considered voluntary because of the circumstances surrounding their departures. In many cases, migrants were offered a choice between going home — or in some cases, to a third country — or facing the threat of “indefinite detention” in a semiopen but remote facility in the Negev desert that does not allow them to work.

“International law is clear that when Israel threatens Eritreans and Sudanese with lifelong detention, they aren’t freely deciding to leave Israel and risk harm back home,” said Gerry Simpson, senior refugee researcher at Human Rights Watch and the author of the report.

Israeli human rights groups have been raising similar concerns in recent months.

Mr. Simpson said it was not possible to ascertain whether any of the 6,700 migrants had left for other, personal reasons, as they were not interviewed on departure. But he said the more likely explanation was that they were coerced into leaving because of the pressure created by Israel’s policies.

Israel strongly contested that assessment, saying it encourages repatriation or departure to a third country but does not compel asylum seekers to do so.

“There are very many baseless accusations against the state, just as these organizations criticize every one of the Western countries because of the way they deal with illegal infiltration,” Gideon Saar, Israel’s interior minister, told Israel Radio. “As a country, we first of all act according to the law and with every step we act in consultation with the attorney general and according to his opinion.”

The Interior Ministry said the Human Rights Watch report was an attempt to influence Israel’s Supreme Court, which is expected to rule soon on a petition against a recent amendment to Israel’s law guiding illegal entry to the country.

Israel’s perception of the African migrants, whom it routinely refers to as “infiltrators” or economic migrants, sharply differs from that held by many nongovernmental organizations and refugee advocacy groups, who view them as asylum seekers fleeing conflict zones or persecution.

“Israel does not forcibly deport these people,” said Mark Regev, a spokesman for the Israeli prime minister’s office. “They have the possibility to be in Israel safely and to have all their humanitarian needs met.”

He added, “The overwhelming majority of these people are illegal job seekers and are not coming here for refugee reasons.”

Israeli officials say the government offers refugees willing to leave $3,500.

Walpurga Englbrecht, the representative for the United Nations high commissioner for refugees in Israel, said Israel might be breaching international conventions that prohibit the forcible return of refugees or asylum seekers to an environment in which they are at risk of persecution or degrading treatment.

The conditions in the Holot facility in the Negev desert, she added, “restrict the freedom of movement of Eritrean and Sudanese residents to a substantial degree, not necessarily in line with international human rights law.”

“Under these circumstances,” she added, “it is reasonable to expect that many would opt for return rather than stay in the facility for an unspecified period of time.”

Alarmed by an influx of about 60,000 Africans since 2005, the vast majority of them Sudanese or Eritreans who crossed the border from Egypt, and after protests by the residents of south Tel Aviv, where the new arrivals were concentrated, Israel announced in 2012 that it was stepping up efforts to deter, detain and deport the migrants. Measures that include the construction of a steel barrier along Israel’s border with Egypt have since cut the flow of African migrants to almost zero.

Some Israelis have argued that their country, which offers refuge to Jews, should be sensitive to others fleeing war, but government ministers have argued that asylum seekers threaten the Jewish character and social fiber of Israel, a small country of eight million.

Many of the migrants are told to report to Holot, the desert facility, when they renew their temporary residency permits, and those who fail to do so risk imprisonment.

There are currently about 1,620 Sudanese and Eritreans at the desert facility, and they are required to be present for roll call three times a day and are locked in at night. Several hundred more migrants are detained in the nearby Saharonim prison, having been arrested after they walked out of Holot this summer to protest conditions there.

Israel’s Interior Ministry did not provide a detailed breakdown of the nationality or destination of those who had left, but its figures show a steep rise in departures so far this year — 5,388 people compared with 2,612 in 2013.

Human Rights Watch also criticized Israel for what it said was a low rate of examining refugee applications and granting refugee status. Israel has recognized three Eritreans as refugees and no Sudanese, according to the United Nations refugee agency.

One Eritrean asylum seeker, in Israel since 2008, described in an interview how he was taken out of school at the age of 17 to serve in the Eritrean Army. He evaded military service for a time, but was ultimately caught and sent to prison. Speaking on the condition of anonymity for fear of drawing the unwelcome attention of the Israeli authorities, he said he escaped and then left Eritrea at the age of 20, and arrived in Israel after spending time at a camp in Ethiopia.

He said his temporary residency permit in Israel, which allowed him to work, had run out. He is afraid to apply for a new one, he said, assuming that he will be sent to Holot.

He said he was also afraid to apply for refugee status, preferring to remain below the radar of the Israeli authorities. A few months ago, he was offered about $3,000 by the Israeli authorities to move to Uganda or Rwanda. “I told them no,” he said. “I would prefer to pay them the money and stay here and have my life.”