Israel scrambled its diplomatic staff out of Egypt early Saturday after protesters tore down a wall and broke into the Israeli Embassy. As thousands more protesters torched police vehicles and clashed with security forces, an Egyptian commando squad rescued six embassy guards trapped inside the building.

Israeli officials who tracked events during the night described tense hours in which Israeli Prime Minister Benjamin Netanyahu spoke by phone with President Obama and the chief of Egyptian intelligence while monitoring events over a direct link to the besieged guards.

Israel’s defense minister, Ehud Barak, also called his U.S. counterparts during the night to ask them to press the Egyptians to do more to protect the embassy.

“Our assessment was that they had 20 minutes to hold out, and in those 20 minutes the Egyptian commandos would arrive,” Foreign Minister Avigdor Lieberman said in a television interview Saturday. “Those were perhaps the longest minutes.”

In response to the crisis, Egypt’s ruling military council announced a security crackdown Saturday, saying it would make full use of the country’s emergency law to ensure safety. It was a move that exposed the fragility of the new government’s control of the streets.

Under President Hosni Mubarak, Egypt’s police force kept a tight lid on the population, and improved civil liberties were a key demand for protesters who ousted their leader in February. Since then, much of the police force has remained off the streets, and other security forces have sometimes struggled with how to respond to protests. On Friday, a small crew of soldiers stood back as crowds massed outside the embassy.

The incident underlined the altered relationship between Israel and post-revolutionary Egypt, in which popular anti-Israeli sentiment, fueled by Israel’s policies toward the Palestinians, has threatened to undermine relations cemented in a 1979 peace treaty and maintained by Mubarak.

The appeals by Israeli leaders to Obama and Defense Secretary Leon Panetta, who urged the head of the Egyptian military council to act as protesters breached the outer doors of the embassy, underlined Israel’s increasing isolation in the region during a time of tumultuous change. Relations with two of its strongest allies, Egypt and Turkey, have soured, and turmoil in Syria further complicates its security calculations.

White House and State Department officials conferred with Israeli and Egyptian officials throughout the day seeking to defuse tensions, and State Department spokeswoman Victoria Nuland called on Egypt “to meet its obligations under the Vienna Convention” to protect foreign missions in its country.

In Israel, Netanyahu delivered a nationally televised statement in which he pointedly avoided criticism of the Egyptian authorities, pledging to uphold Israel’s 1979 peace treaty with Egypt and restore the ambassador to his post.

“We will continue to preserve the peace with Egypt,” Netanyahu said. “It is an interest of both countries.”

He added that “we are working with the Egyptian government for a speedy return of our ambassador to Cairo” with the necessary security measures for him and his staff.

The intervention of the Egyptian commandos “undoubtedly prevented a disaster,” Netanyahu said, adding that only “one door” separated the guards from the mob that had broken into the building.

The ambassador and other embassy staff members were not there; it was Friday night, the Jewish Sabbath, and a day off in Egypt, when the embassy is closed.

Netanyahu also thanked Obama, who he said “used all the means and influence . . . of the United States” to press the Egyptians to take action to protect the embassy and rescue the guards.

Cairo’s streets on Saturday reflected the government’s shift toward tighter control of public spaces after weeks of taking a more low-key approach to security.

The protesters at the embassy “have put Egypt in a difficult situation,” Osama Heikal, the information minister, said in an announcement that was aired repeatedly on state television. “Security forces will be allowed to take all possible legal measures to deal with incidents of thuggery and aggression against public facilities,” he said after an hours-long meeting between the civilian cabinet and the military council.

Repeal of the emergency law, which allows indefinite detention and sharply curtails political activities, was a key demand of the protesters who took to the streets to topple Mubarak. The military council had said it would repeal the law once Egypt’s situation stabilized.

Israeli-Egyptian ties, tense since Mubarak’s ouster, worsened rapidly after a mid-August incident in which five border guards were killed as Israeli troops pursued militants who had crossed from Egypt’s Sinai Peninsula and carried out a deadly attack north of the Israeli resort town of Eilat.

Some protesters in Egypt called for a downgrade in diplomatic relations, a goal that appeared to have been achieved early Saturday when Ambassador Yitzhak Levanon, embassy staff members and families — about 80 people — boarded a military flight to Israel. The six freed Israeli guards followed on another flight, leaving only the deputy ambassador in Cairo.

Egyptian government officials and many of the activists who led the winter protests condemned the embassy break-in. But many saw it as the latest manifestation of a changing posture toward Israel in post-revolutionary Egypt.

“Mubarak was the guardian of this relationship, and he’s gone now,” said Refaat Sayyid Mohammad, an Egyptian political analyst.

Three people were killed and more than 1,000 were injured in clashes with police during the protest, according to the Egyptian Health Ministry.

Diplomats in Cairo expressed concern, wondering whether their own embassies were secure and criticizing the military council’s approach to security in the past weeks.

“They just turned a blind eye when all this was going on toward the Israelis, for week after week,” one Western diplomat said. Now the council is “in the terrible position where they have to show that they’re strong.”

Greenberg reported from Jerusalem. Staff writer Joby Warrick in Washington and special correspondent Ingy Hassieb in Cairo contributed to this report.