JERUSALEM — Prime Minister Benjamin Netanyahu has promised to step up efforts to deter, detain and deport illegal migrants to Israel, as tensions mount over an influx of asylum seekers from Africa. His pledge came a day before an early morning fire, apparently set by arsonists, ravaged an apartment occupied by about 10 Eritrean migrants on Monday. Four people were injured.

Though there have been a number of firebomb attacks against migrants in south Tel Aviv in recent weeks, the fire was the first attack on migrants in Jerusalem, the police said.

Dozens of foreigners, including families with children, lived in the building where the fire broke out, on Jaffa Road, one of the city’s central arteries. Four residents were taken to a hospital with burns to the hands and smoke inhalation. Graffiti sprayed on a stone wall by the entrance of the building read: “Get out of the neighborhood.”

Mr. Netanyahu has condemned violence against illegal migrants, who are known here by the Hebrew word for infiltrators. But he has also expressed a policy of zero tolerance for the flow of Africans crossing surreptitiously into Israel from the Egyptian Sinai.