An apartment housing 10 Eritreans has been firebombed in Jerusalem, against the backdrop of rising anti-migrant sentiment in Israel.

Four of the occupants were taken to hospital suffering burns and smoke inhalation. Graffiti sprayed on the walls of the building said: "Get out of the neighbourhood."

The Jerusalem fire department and police said arson was indicated. "This looks like an arson attempt on an apartment which housed Eritrean migrants. The police [are] treating this all due seriousness and will employ all means at its disposal to apprehend those responsible," said a police statement.

The attack in the early hours of Monday morning follows a series of firebombings in southern Tel Aviv – an area in which African migrants are concentrated – including apartments and a kindergarten. Shops run by or serving migrants were smashed up and looted in a violent demonstration last month, in which Africans were attacked.

Politicians, including the prime minister, Binyamin Netanyahu, and the interior minister, Eli Yishai, have inflamed the volatile mood by suggesting Israel is being flooded with "illegal infiltrators", that migrants are responsible for a crime wave and calling for all migrants to be locked up or deported.

On Sunday, a law came into effect allowing the Israeli authorities to jail migrants for up to three years. Netanyahu also ordered ministers to accelerate efforts to deport 25,000 migrants from countries with which Israel has diplomatic relations, principally South Sudan, Ivory Coast, Ghana and Ethiopia.

He conceded it was not possible to deport around 35,000 migrants from Eritrea, Sudan and Somalia. Eritreans and Sudanese make up more than 90% of those illegally crossing the Israel-Egypt border in recent months.

Israel is building a 150-mile (240km) steel fence along the border, which may have the short-term effect of increasing the numbers attempting to cross into Israel before it is completed later this year.

During a tour of the fence on Sunday, a member of the Israeli parliament said that troops should fire on anyone attempting to cross the border illegally. "Anyone that penetrates Israel's border should be shot, a Swedish tourist, Sudanese from Eritrea, Eritreans from Sudan, Asians from Sinai. Whoever touches Israel's border – shot," said Aryeh Eldad. He later conceded that such a policy may not be feasible "because bleeding hearts groups will immediately begin to shriek and turn to the courts".

Last week, Yishai said the area of Tel Aviv in which African migrants were concentrated had become "the country's garbage can" and suggested that HIV-positive migrants were raping Israeli women.

Migrants have reported a climate of fear, and some have blamed politicians for stoking racial hatred. According to the population and immigration authority, there are 62,000 migrants in Israel. It said 2,031 migrants entered Israel via Egypt last month, compared with 637 last May. Israel's population is 7.8 million.

Israel granted asylum status to one applicant out of 4,603 applications in 2011, according to the US state department, which last week criticised Israel for its routine use of the term "infiltrators" to describe migrants.