JERUSALEM — After a lull in the latest round of fighting between Israel and Hamas on Thursday, militants in Gaza fired a rocket toward the southern Israeli city of Beersheba, a major population center about 25 miles away, for the first time since the last war in 2014.

In response, Israeli missiles flattened a five-story building in western Gaza City, injuring 18 people, according to Gaza health officials. Israel said the building was used by Hamas’s security forces for military purposes. The Palestinians said it was a center for the arts, housing a theater and a library, as well as an office serving Egyptians residing in Gaza.

The sharp blows left many wondering if these were the final shots ushering in a new, if fragile, cease-fire, or the opening shots of the next war.

Officials in Gaza said late Thursday that a cease-fire brokered by Egypt and the United Nations envoy to the region, Nickolay Mladenov, would begin at midnight. They described it as a limited understanding of “calm for calm.” But it was not likely to be any more stable than the cease-fires that came before.