The incident happened while the soldiers were involved in a clash with Palestinian militants in Gaza.
The army said the group had been trying to plant explosives underneath the security fence along the border.
The clash follows a month of increased tension along the Gazan border with frequent exchanges of fire.
Witnesses in Gaza earlier told news agencies they had heard loud explosions close to the border, a short distance from the Nirim kibbutz on the Israeli side.
The Israeli military initially said four soldiers had been injured.
But they later said the men, who were part of a group patrolling the border, had been hit by Israeli fire. It also said one had died.
"The soldiers were hit by a stray mortar shell fired by Israeli forces as they engaged with Palestinian militants along the border," an army spokesman said.
The army said it was investigating the incident.