Israel's military disputed the death toll and said soldiers had fired warning shots as thousands gathered near Gaza City.