GAZA CITY — For weeks, Palestinians protesting along the fence between Gaza and Israel have conjured up the idea of swarming across the barrier, a mass of tens of thousands of people too numerous for Israeli soldiers to arrest or even to shoot.

And Israelis have been worrying aloud about what their soldiers would do in response.

On Friday, both sides got a small sense of what that could mean when hundreds of Palestinians, urged on by a Hamas leader in a fiery midafternoon speech, rushed the security barrier at the eastern edge of Gaza City and tried to cross into Israel.

Dozens made it through a barbed-wire barrier about 30 yards inside Gaza territory, deploying wire cutters, hooks and winches. Israeli troops opened fire with a mix of live ammunition and rubber bullets, killing three people and wounding nearly 1,000 more, according to Gaza health officials.