Gunfire erupted at the Egypt-Gaza border crossing late Thursday, hours after Hamas militants tried to seize control of the terminal.
Witnesses said Hamas gunmen were firing at the Egyptian side of the border, drawing return fire from the Egyptians and presidential guards from the rival Fatah movement.
The violence broke out as Palestinian officials were trying to negotiate the return of Prime Minister Ismail Haniyeh to Gaza from Egypt.
During the battle, masked gunmen in three cars and a bulldozer stormed the terminal, witnesses said. The gunmen went on a rampage inside the building, destroying computers and furniture inside and plunging the area into darkness, the witnesses said.