Cairo also demanded a formal apology from Israel and a probe to determine the circumstances of the deadly shootings which happened during retaliatory attacks on Palestinian militants following the killings of eight Israelis.[break]
"Egypt has decided to withdraw its ambassador to Israel until there is an official apology," state television reported.
The Egyptian government asked "for an official apology from Israel" at the end of a crisis meeting overnight, the state-run MENA news agency added.
Information Minister Osama Heykal was quoted as saying by MENA that five policemen were killed "inside Egyptian territory as a result of an exchange of fire between Israeli forces and armed elements inside Israeli territory."
There had been conflicting reports of the deaths.
Security forces told AFP that five policemen, including an officer, were killed at the border on Thursday during an Israeli pursuit of militants who killed eight Israelis.
The military initially told MENA on Thursday that two policemen were killed when an Israeli aircraft opened fire on the fleeing militants, catching the policemen in the line of fire.
But military and security officials later said the policemen were killed in a clash with gunmen as they tried to enter Egypt.
The violence has triggered anger among Egyptians with hundreds demonstrating overnight outside the Israeli embassy in Cairo demanding the expulsion of the Israeli ambassador and denouncing the Jewish state.
"Sinai, Sinai," the crowds shouted in reference to the Sinai peninsula where the Egyptian policemen were killed and, "Down with Israel. The people want the ambassador out and the Israeli flag down."
On Saturday dozens were still camped outside the building housing the embassy and some torched Israeli flags, an AFP photographer said, as riot and military police stood guard.
Prime Minister Essam Sharaf also expressed his anger in a message he published on his Facebook page.
"Egyptian blood is too precious to be spilled for no reason," wrote Sharaf.
"Our glorious revolution took place so that Egyptians could regain their dignity at home and abroad. What was tolerated in pre-revolution Egypt will not be in post-revolution Egypt," he said, referring to the ouster of president Hosni Mubarak´s regime.
Despite a 1979 peace treaty with Israel, many Egyptians still view their neighbour with hostility and there have been calls to revise the peace agreement after a popular revolt ousted Mubarak in February.
The military, which took power after Mubarak´s overthrow, has said it would honour the treaty.
It is the second time that Egypt recalls its ambassador from Israel since the two neighbours made peace.
In November 2000 Egypt recalled its envoy to protest "the excessive use of force by Israel against the Palestinians after the second intifada."
The latest decision prompted Israeli diplomatic officials to hold "consultations," foreign ministry spokesman Yigal Palmor told AFP without elaborating.
A top Israeli defence official stressed meanwhile that peace with Egypt "is a strategic asset" and it would be unthinkable for Israeli personnel to target their Egyptian counterparts.
Amos Gilad, head of the defence ministry political department, also urged patience until the results of a probe, which Israel pledged to carry out, are known.
"Nobody in the army, nobody anywhere in the security establishment has any intention of harming Egyptian soldiers or Egyptian policemen, on the contrary, the intention of course is to not harm them," he said.
"No soldier would consciously aim his weapon at Egyptian soldiers or policemen," Gilad told Israeli public radio.
Egypt filed a complaint with Israel on Friday and demanded an "urgent probe" and since the overnight meeting the foreign minister has been instructed to summon the Israeli ambassador to issue a protest.
"Security at the Egyptian-Israeli border is the common responsibility of both parties, not only Egypt´s responsibility," the government´s statement said.
The Egyptian military has been conducting a week-long operation in the peninsula to uproot Islamist militants behind attacks on police and a gas pipeline to Israel.
As the diplomatic spat unfurled Israel´s former ambassador to Cairo arrived in the Egyptian capital, an airport official said, although the purpose of his visit was not immediately clear.