Palestinian militants killed one Israeli soldier and wounded four others when they detonated a booby-trapped chicken coop in the central Gaza Strip.
Hamas claimed to have set an elaborate trap
The attack was claimed by Hamas, which said two of its fighters were killed in gun battles following the explosion.
The Israeli army quickly struck back, killing two militants from the Islamic Jihad group in a missile attack.
There have been few such incidents in the weeks since the death of Palestinian leader Yasser Arafat.
The renewed clashes come just over a month before Palestinians vote for a new leader of the Palestinian Authority on 9 January.
The chicken coop exploded in a huge blast as Israeli troops searched for hidden weapons on the Karni-Netzarim road south of Gaza City just before dawn.
At a rare press conference later, armed Hamas men wearing masks said that months of preparation had gone into setting the ambush.
Youths who had come to watch were injured by Israeli fire
A tunnel had been dug under the chicken coop and more than a ton of explosives was packed into it, the militants said.
They also claimed that a member of the organisation had pretended to be a collaborator, supplying the Israelis with information that was intended to draw soldiers into the booby-trapped area.
Israeli forces hit back by firing a missile which killed two Islamic Jihad fighters and at one point making a brief incursion into al-Sejaiya neighbourhood of Gaza City, which is controlled by militants.
About 10 Palestinian civilians were also injured, at least four of them schoolchildren, when they were hit by Israeli tank and gunfire during the incursion.
Hamas said two of its fighters had died in the 45-minute shoot-out that followed the ambush.
The BBC's Alan Johnston in Gaza says Israeli forces that occupy the Strip and defend Israeli settlements frequently come under attack, but there have been fewer such clashes in the weeks since Yasser Arafat died.
This is thought to be the heaviest fighting in Gaza since the death of the veteran Palestinian leader.
Our correspondent says that recent weeks have seen talk of a Hamas ceasefire, but Tuesday's clashes are a reminder of just how fierce the Israeli-Palestinian conflict can still be.
In another development, jailed Fatah intifada leader Marwan Barghouti was reported to be considering dropping out of the race to replace Arafat.
Polls show him neck-and-neck against Fatah chairman Mahmoud Abbas - who has the tacit support of Israel and the United States.
Israel is planning to pull all its 8,000 settlers from Gaza and the troops that protect them as part of a disengagement plan. Israel will maintain control of Gaza's borders, coastline and airspace.