GAZA CITY, Gaza Strip — A three-day cease-fire in the Gaza Strip went into effect Friday following heavy Israel-Hamas fighting that killed 17 Palestinians and five Israeli soldiers.

The cease-fire, announced by the U.S. and the U.N. hours earlier, took effect at 8:00 a.m. Friday. U.S. Secretary of State John Kerry cautioned there were “no guarantees” that the lull would bring an end to the Gaza war, now in its fourth week.

Israel and Hamas both said they would respect the cease-fire but would respond to attacks.

At least four short humanitarian cease-fires have been announced since the conflict began, but each has been broken within a few hours by renewed fighting.

Hours before the cease-fire was to take effect, 17 Palestinians were killed in Israeli strikes, including 10 people from the same family, said Ashraf al-Kidra, a Gaza health official. He said the family members were killed in an airstrike on their home in the southern Gaza town of Khan Younis.

Israel’s military said five of its soldiers were killed along the Gaza border Thursday evening when a mortar round was fired at them.

More than 1,450 Palestinians have been killed since hostilities began July 8, according to Palestinian officials. Israel says 61 of its soldiers and three civilians in Israel have been killed.

In the hours before the cease-fire took effect Friday, Gaza police reported heavy Israeli tank shelling in northern and eastern Gaza, and the loud exchange of fire between Israeli troops and militants was audible throughout Gaza City. Tank shells landed on homes in the city, setting homes and shops ablaze.

Hamas fighters hit an Israeli tank with an anti-tank missile, Gaza police said, and then attacked Israeli troops who came to evacuate the tank crew. Clashes continued into the early morning hours, police said.