The Israeli military says two soldiers were killed in a fierce firefight with militants Friday who were planting explosives along the security fence in the southern Gaza Strip.

Two other Israeli soldiers were evacuated to a hospital after being wounded in the exchange of fire, which the military blamed on Hamas, holding the militant group "solely responsible for maintaining peace and quiet in the Gaza Strip."

Israel says its soldiers opened fire on the militants planting explosives, killing two of them.

Friday's violence was some of the worst in the Hamas-run Gaza Strip since Israel's military offensive there more than a year ago.

Two Palestinians, one a 10-year-old boy, were also wounded, Gaza hospital officials told the Associated Press. 

Witnesses said Friday's firefight began when an explosion, possibly caused by an anti-armor rocket fired by militants from the nearby Palestinian town of Khan Younis, hit an Israeli army patrol on the central Gazan border, Reuters reported.

Israeli troops fired back at their assailants and entered Gaza with the aid of tanks, witnesses told Reuters. Security officials with Gaza's Hamas-run Interior Ministry said Israeli soldiers were firing artillery and tank rounds near Khan Younis. Footage broadcast on Al-Arabiya television showed ambulances that were unable to reach the scene of the fighting because of the gunfire waiting in alleyways as residents gathered around.

The Hamas military wing's Web site said its gunmen were involved -- a departure from the Islamic militant group's tendency over the past year to avoid confrontation with Israeli forces.

Tensions are running high along the Gaza border, Reuters reported, as Israel has launched repeated air strikes in response to Palestinian rocket attacks, one of which killed a Thai national working on a kibbutz.

An Israeli soldier was killed by friendly fire this week as soldiers scrambled to intercept three Palestinian border-jumpers who were later found to have been looking for work in Israel, Reuters reported.

The Associated Press and Reuters contributed to this report.