The Israeli army said three armed Palestinians attacked the Erez checkpoint between Israel and Gaza before daybreak on Thursday, the latest in an escalating series of violent incidents in the volatile territory.
A Palestinian resistance group spokesman confirmed the attack and added that fighters had inflicted casualties on the Israeli side.
There was no confirmation from the army of any Israeli casualties.
An army spokeswoman said the armed men infiltrated into the Israeli side of the Erez border crossing and threw hand grenades at the checkpoint before being killed.
The spokeswoman said: "The gunmen attacked the Israeli side of the Erez border crossing, they threw hand grenades and two of them were killed by soldiers."
"This was a joint attack by gunmen who penetrated the Erez crossing and opened fire on the soldiers who were unaware of their presence, causing casualties among the soldiers"
Spokesman for Gaza fighters
A spokesman for the Gaza fighters said that two men from the Popular Resistance Committees and the Al-Aqsa Martyrs' Brigades, a part of the Fatah faction, had been killed in the attack.
The spokesman, who refused to be named, said: "This was a joint attack by gunmen who penetrated the Erez crossing and opened fire on the soldiers who were unaware of their presence, causing casualties among the soldiers."
The Erez checkpoint is the main crossing for thousands of Palestinian workers with jobs in Israel. Israel routinely closes the crossing after violent incidents, leaving the workers idle.