Two Israeli soldiers were killed in a gun battle with Gaza militants in some of the fiercest fighting in the territory since Israel's military offensive there more than a year ago. The deaths were the first for the Israeli military in Gaza since January 2009.

Israel-violence-cp-150549

Israeli army medics and hospital workers stretcher a wounded Israeli soldier at a hospital in Beersheba, south Israel. Two soldiers died Friday in some of the fiercest fighting in the region in months. ((Yehuda Lahiani/Associated Press))

Four militants died in the clashes and in another exchange of fire nearby. Gaza's Islamic Hamas rulers announced that their gunmen were involved — marking a shift from the group's tendency over the past year to avoid confrontation with Israeli forces.

The outbreak of violence in Gaza, which subsided by early evening, highlighted the region's volatility as the U.S. pushes to get Israeli-Palestinian peacemaking back on track.

Israel's military said the soldiers were killed inside Gaza during an exchange of fire with militants who were planting explosives along the security barrier on the Israel-Gaza border. It was the first time an Israeli soldier had been killed in Gaza since Jan. 27, 2009, shortly after last year's war ended, the military said.

It said Israeli troops opened fire on the militants, killing two. In the same area, soldiers also battled another group of militants placing explosives, killing two, military spokeswoman Lt.-Col. Avital Leibovich said.

Hamas official Ismail Radwan said the deaths of the soldiers was a "gift" from Hamas to Jerusalem and to Hamas operative Mahmoud al-Mabhouh, who is widely believed to have been slain by Israeli agents in January in a Dubai hotel.

Farther south in Gaza, Israeli forces backed by tanks and helicopter gunships battled throughout the afternoon and evening with militants in a sparsely populated border area near the city of Khan Younis, Hamas security officials said. Militants responded with mortar fire, they said.

The Israeli military described the action in the area as a routine defensive operation meant to protect southern Israel from militants who attack it with rockets and explosives.

Gaza medical officials reported that eight civilians were injured in the fighting, including three hurt in an aerial attack.