Mr. Netanyahu tweeted on Tuesday that the attacks against Hamas would “continue as long as necessary to restore calm to the citizens of Israel.”