JERUSALEM — 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 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.

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 for Hamas, told Israel Radio. “We’re in touch with all the Palestinian factions. The situation is under control.”