[Updated, 4:52 p.m.] Israel Defense Forces identified its dead soldiers as Staff Sgt. Ilan Sviatkovsky and Maj. Eliraz Peretz.
After seeing the "terrorists" plant explosives, IDF moved forward and fired, killing two militants, said Southern Command Maj. Gen. Yoav Galant, according to IDF's Web site.
"The soldiers advanced in a proper operational manner and when the terrorists were seen moving westward, tanks that were stationed undercover opened fire," Galant said, according to IDF's Web site. "One of the terrorists approached the forces point blank and opened fire."
Sviatkovsky was killed when a bullet hit a hand grenade that was on his vest, IDF said. The explosion also wounded the two other soldiers. Peretz was killed in an exchange of fire, IDF said.
[Updated, 4:45 p.m.] The number of Palestinian civilians hurt now stands at eight, local medical sources said. Two of them - including a child - were seriously wounded and two others were moderately wounded, the sources said.
Meanwhile, Hamas said one of its fighters was killed, and it lost contact with another.
[Posted, 1:42 p.m.] Two Israeli soldiers and two Palestinian militants were killed in a gunfight Friday in Gaza, authorities said.
Israel Defense Forces said there was exchange of fire "with terrorists who were planting explosives along the security fence in the Gaza Strip."
Two other soldiers were wounded.
Along with the two Palestinian militant deaths, four Palestinian civilians were hurt, local medical sources said.
The military wing of Hamas, the Palestinian group that controls Gaza, said in a statement that its forces clashed with Israelis near the Khan Yunis area of southern Gaza.