An Egyptian-brokered cease-fire between Israel and Palestinian militants in the Gaza Strip took hold Monday, as airstrikes and rocket salvos triggered by a deadly attack by gunmen in southern Israel tapered off after five days of fighting.

Israel’s relations with Cairo were strained last week after three Egyptian security officers were killed as Israeli forces pursued the gunmen responsible for the attack near the border with Egypt on Thursday. The killings led to furious protests outside the Israeli Embassy in Cairo and a threat by Egypt to recall its ambassador to Israel.

After expressing regret for the deaths, Israel scaled back its attacks in Gaza and halted them Monday as militants announced a suspension of their rocket strikes.

While asserting that Israel was responding to the halt in rocket fire, some Israeli officials acknowledged that concern for the relationship with Egypt, where there is strong popular sympathy for the Palestinians, had contributed to the decision to suspend attacks in Gaza.

“We want to fix things with Egypt; of course it’s on everybody’s mind,” one official said. “Egypt is always a factor when dealing with Gaza.” The official spoke on the condition of anonymity because he is not authorized to speak publicly.

As part of the efforts to smooth relations with Egypt, an Israeli military delegation flew to Cairo on Sunday to share preliminary findings of the army’s investigation into the killing of the Egyptian security officers and to discuss the cease-fire in Gaza.

Officials of Hamas, the Islamist group that rules the Gaza Strip, said an agreement to halt the fighting had been reached with the mediation of Egypt and the United Nations, whose special coordinator in the Middle East, Robert Serry, was also in Cairo on Sunday.

“There is an understanding to stop all the operations on both sides,” Ghazi Hamad, the deputy foreign minister in the Hamas government, told Israel Radio. “We’re in touch with all the Palestinian factions. The situation is under control.”

A spokesman for the Popular Resistance Committees (PRC), Abu Ataya, announced that the group, which had led the rocket attacks on Israel, had agreed to a “temporary” cease-fire “to serve the interest of our people.”

But he said talk of a more permanent truce was “out of the question,” adding: “We have an open account with the enemy until it leaves Palestine.”

Israel accused the PRC of carrying out Thursday’s attack near the southern resort town of Eilat — which left eight people dead — and killed its leader hours later in an airstrike, prompting the rocket fire. In the following days, further air attacks in Gaza killed 14 Palestinians, most of them militants, and wounded more than 50. Rockets fired at cities and towns in southern Israel killed one man and wounded more than 20 people.