The border standoff dramatized as never before Israel’s dilemma over how to stop the influx of tens of thousands of Africans fleeing repressive governments who are seeking illegal entry to Israel and the Jewish state’s collective memory as a nation built by refugees. Although similar border confrontations have occurred in the past, this was the first caught on camera.

It was also a visceral test of Israel’s resolve to defend a newly built border fence for the express purpose of blocking militants and African migrants.

“This issue is very divisive. It goes to the roots of what it means to be a Jewish state,” says Oren Persico, a columnist at the Seventh Eye, an Israeli media magazine.

Although the debate over the African migrants has gone on for most of this year, never before have Israelis watched a life-threatening confrontation play out at the border. “You got the sense that the media uproar could have changed the outcome,” Mr. Persico says.

Photographs showed a small group of Africans huddled under a tarp just outside the border fence while television footage showed soldiers blocking human rights workers seeking to provide food and medicines to the migrants, who they feared might perish after days of exposure in the desert. The media reported that one of the women suffered a miscarriage at the border.

Their plight was taken up by the Israeli Supreme Court in an emergency session today, but it adjourned until Sept. 9 with no decision.

The compromise — allowing the women and teenager to stay while sending back all the men — allowed Netanyahu to show his resolve to enforce a get-tough policy against the migrants, while allowing for humanitarian exceptions. The three who will be allowed to stay in Israel will be kept in a detention center.

“It is important that everyone will understand that Israel is not another destination for infiltrators,” Mr. Netanyahu said in a statement, which noted that there has been a 90 percent drop in the arrivals. “We are determined to stop the deluge of infiltrators.”

In recent years, tens of thousands of Africans, mostly from Sudan and Eritrea, have reached Israel by illegally crossing the border on foot from Egypt. Israel has given those from Sudan’s Darfur region, a fraction of the total refugees, permanent residency, and the rest have been given provisional approvals to live and work in the country without being recognized as refugees, which means the state could swiftly revoke their status at any time.

Netanyahu has called the unchecked influx of African migrants a top national threat to Israel, claiming it threatens to erode the country’s Jewish majority and weaken the economy. He has tried to highlight efforts to reduce the number of asylum seekers arriving to play to public opinion, which supports blocking entry, and has even forced several hundred South Sudanese to leave the country.

His government has sponsored legislation permitting the Africans — which it considers migrant workers, not asylum seekers — to be detained for three years, and is building a large detention center near the border for those who are caught crossing.

Israeli human rights advocates have argued that Israel has a moral and legal obligation to look after anyone who reaches its soil and to allow them to work. They have criticized Israel’s government for not considering giving them political asylum.

Sigal Rozen, a spokeswoman at the Hotline for Migrant Workers, said the move to return the Africans to Egypt was a violation of international law. She argued that even though numbers of migrants are down after the construction of the fence, the barrier will not completely stop the flow.

“People will keep on coming,” she says. “There will be some that will try their luck.”