Egypt declared a state of alert early this morning after a group of 30 protesters broke into the Israeli embassy in Cairo last night and dumped hundreds of documents out of the windows.

The storming of the building came after a day of demonstrations outside where crowds swinging sledgehammers and using their bare hands tore apart the embassy's security wall. Hundreds of people converged on the embassy throughout the afternoon and into the night, tearing down large sections of the graffiti-covered security wall outside the 21-storey building. For hours, security forces made no attempt to intervene.

A security official, who spoke on condition of anonymity because not authorised to speak to the media, said that one group of protesters reached a room on one of the embassy's floors at the top of the building just before midnight and began dumping Hebrew-language documents from the windows.

The prime minister, Essam Sharif, summoned a crisis cabinet meeting to discuss the situation. In Jerusalem, an Israeli official confirmed the embassy had been broken into, saying it appeared that the group reached a waiting room. In Cairo, officials at the capital's airport said the Israeli ambassador was there waiting for a military plane to evacuate him, and other Israelis were also waiting for the flight to take them back to Israel.

Barack Obama expressed concern at the intrusion and told the Israeli prime minister, Binyamin Netanyahu, that he was taking steps to help resolve the situation without further violence. Obama called on the Egyptian government to honour its international obligations to safeguard the embassy.

The attack came two days before a scheduled visit by the Turkish prime minister to Cairo amid concern in Israel that he may seek an alliance between the two countries with the aim of increasing the Jewish state's isolation in the region.

Recep Tayyip Erdogan's visit, the first by a Turkish leader for 15 years, comes against the backdrop of a spiralling diplomatic offensive against Israel by Ankara which the US is seeking to contain.

During Monday's talks, Turkey and Egypt are expected to explore co-operation, and Erdogan may offer the post-Mubarak government much-needed financial aid, which would inevitably secure him leverage.

"Turkey may be ready to invest a lot of money and effort into building Egypt as a regional ally," said Alon Liel, a former Israeli envoy to Ankara. "He may try to persuade them to downgrade relations with Israel."

According to Yossi Alpher, an analyst and co-editor of the bitterlemons website, Erdogan "is flexing Turkey's muscles. He's now trying to project Turkish influence into Egypt. There's concern he will offer financial aid to Egypt, which needs it desperately, and that will give him a degree of influence. There's concern Erdogan will hook up with the Egyptian Islamists, who are growing in influence.

"And there's concern that he will persuade the Egyptians to allow him to visit Gaza, where he'll proclaim himself its saviour. None of this is good from Israel's perspective."

In Gaza, Erdogan would get a hero's welcome and incur Israel's anger. But an Israeli government source said that it had not picked up indications the Egyptians had agreed to Erdogan crossing their border into Gaza.

The visit to Cairo follows a series of punitive measures by the Turkish government – including expelling the Israeli ambassador, suspending defence trade agreements and threatening to deploy the Turkish navy to patrol the eastern Mediterranean – since Israel refused to apologise for its deadly attack on a Gaza-bound flotilla last May.

A UN report published a week ago concluded Israel had used "excessive and unreasonable" force in stopping the Mavi Marmara, although it also stated that the Israeli naval blockade of Gaza was legal. Nine Turkish activists were killed on the ship, for which Turkey demanded an apology and compensation for the men's families.

Israel's refusal to apologise contrasted with its swift statement of regret three weeks ago when Egyptian security personnel were shot dead after a militant attack near the Egypt-Israel border in which eight Israelis were killed.

"The mistakes that Israel is making are much more evident in the case of Turkey than in the case of Egypt," said Alpher. "Damage control was relatively more forthcoming with the apology to Egypt than in the case of Turkey, where we basically allowed ourselves to walk right into repeated traps that Erdogan has set for us."

The regret expressed to Egypt was not enough to prevent days of anti-Israel protests in Cairo. To Israel's alarm, the post-Mubarak government made it clear it was listening to the mood on the street.

Israel can ill afford to lose regional allies, especially in the runup to an expected vote to recognise a Palestinian state at the UN general assembly this month. Turkey and Egypt are backing the Palestinian bid. As well as wide political ramifications, a breach with Turkey could have serious economic consequences, Stanley Fischer, governor of the Bank of Israel, warned this week. Trade between the countries is worth $3.5bn-$4bn a year. The breach "will affect tourism, trade, culture and sport" as well as diplomatic relations, said Liel.

Israeli government ministers and officials have been issued clear instructions to refrain from comment in an attempt to de-escalate the crisis. But the Israeli paper Yedioth Ahronoth reported on Friday that Avigdor Lieberman, the provocative rightwing foreign minister, is considering a series of measures against Turkey in retaliation for Ankara's moves.

According to Alpher, that would exacerbate the current crisis. "We have a lot to lose not just economically but also regionally, to the extent that we get drawn deeper into a clash with Turkey," he said. "We were foolish not to apologise [for the Mavi Marmara deaths]. We should still be trying to maintain a low profile and hope friends like the US can try to some extent mend fences here before things get worse."