Updated

Two Hamas gunmen, among dozens holed up in a Gaza mosque, and two Palestinian women who were part of a human shield being used to aid in their escape were shot and killed by Israeli troops Friday, ending a 19-hour seige.

At least 10 women were injured, hospital officials said.

The women, many with ties to Hamas and wearing long robes and veils, had left their homes after daybreak Friday in response to appeals for help on the local Hamas radio station or phone calls from friends and relatives to come rescue dozens of Palestinian gunmen who had taken refuge Thursday night in the town's Al Masser Mosque.

The gunmen were quickly surrounded by Israeli forces, with the two sides exchanging fire throughout the night.

An army bulldozer knocked down an outer wall of the mosque, causing the ceiling to collapse.

As the women marched toward the mosque and approached Israeli troop positions, several soldiers fired shots, though not directly at the women.

The army said most of the gunmen inside the mosque were able to take advantage of the demonstration to escape because there weren't enough infantrymen to block the protesters as they ringed the building, and troops didn't want to shoot into the crowd.

An army spokesman said troops opened fire only when they spotted two militants disguised as women trying to join the crowed.

Both men were killed, along with two women, both age 40, hospital officials said.

A spokesman for Hamas said 32 gunmen who had taken cover in the mosque escaped with the help of the women. The spokesman, Abu Obeida, denied reports that the men disguised themselves as women to escape, but one woman said she handed women's clothing to some of the gunmen.

Dozens of protesters took sanctuary in a U.N. school in Beit Hanoun, fearing retribution by troops, said Imad Okal, an official with the U.N. Relief and Works Agency.

By nightfall, the dead women were celebrated as heroes, an unusual role for them in a deeply conservative society that tends to keep them on the sidelines. Battling Israeli troops had always been men's business in Gaza.

Israeli Army Maj. Avital Leibovich said Hamas was exploiting women.

"They were using those poor women as human shields," she said. "This is a clear example of use of innocent population for terror."

Prime Minister Ismail Haniyeh of Hamas "saluted the women of Palestine ... who led the protest to break the siege of Beit Hanoun." Haniyeh urged U.N. Secretary General Kofi Annan to witness firsthand "the massacres of the Palestinian people," and appealed to the Arab world to "stop the ongoing bloodshed."

The mosque standoff came on the third day of Israel's fiercest bid in months to halt Palestinian rocket fire on Israeli border communities. The offensive began Wednesday, when Israeli forces took over the northern Gaza town of Beit Hanoun, close to the border with Israel.

The army said it targeted Beit Hanoun because it was a major staging ground for rocket attacks. But Israeli officials have said the takeover of the town did not signal the start of a wider-scale military offensive in Gaza.

In other action, Israeli airstrikes around the northern Gaza town of Beit Lahiya after dark Friday killed three Palestinian militants and wounded several more, Palestinian security officials said.

The strikes, the latest of several during the day, brought the number of Palestinians killed in a three-day Israeli operation in the area to 27.