Three people, including a bystander, were wounded in the clashes on Wednesday, which broke out after dozens of gunmen from the al-Aqsa Martyrs Brigades poured into the building to demand jobs, complaining they were marginalised in the ruling party of the Palestinian president, Mahmoud Abbas.
They clashed with rival gunmen, also from Fatah, who wanted them to leave. It was the third straight day of turmoil in Gaza, seen as a testing ground for Palestinian statehood following Israel's pullout after 38 years of occupation.
Elections are set for January, and Hamas is expected to mount a serious challenge to Fatah's traditional dominance in parliament.
A flare-up of election-related violence in Gaza on Tuesday prompted election officials to suspend operations, but Gaza offices re-opened on Wednesday after security forces were deployed outside to protect them.
The election, viewed as a test of Abbas's leadership, comes as he is struggling to contain unrest in Gaza, where factions are vying for sway after Israel's pullout in September.
Hanan Ashrawi, a Palestinian lawmaker, said, "We can't allow a group or a handful of armed groups or militias to threaten the holding of elections in a fair and free environment. We can't allow them to hijack the electoral process."
She said she would run for parliament on an independent ticket with Salam Fayyad, who resigned as finance minister last month and has battled parliament over its refusal to implement fiscal reforms he recommended.
Hanan Ashrawi: We can't allow
militias to threaten the elections
Palestinian fighters, worried they will not be fairly represented on Fatah's ticket after complaints about the handling of the ruling party's primary ballot, have stormed election offices in recent days to demand a delay in the 25 January poll.
They want elections postponed so Fatah can repeat party primaries that were halted in some areas after fraud allegations and violence by gunmen, some from the al-Aqsa group.
The gunmen, who spent years battling Israel but sometimes felt marginalised in Fatah because of the dominance of Old Guard leaders, fear that unless Fatah picks its candidates in a popular vote, the group will have a hard time beating back Hamas at the polls.
With hours left to officially register candidates for the elections, new primaries appeared unlikely.
Hamas has announced Ismail
Haniyeh (L) as its top candidate
Extending a midnight registration deadline would risk delaying the polls, which Abbas has vowed to hold on time.
Hamas registered its candidates ahead of the deadline and said senior Gaza leader Ismail Haniyeh topped its list. Fatah has yet to announce who will run on its ticket.
Well-known Hamas hardliner Mahmoud Zahar is ninth on the list of candidates.
Women in the running
"We are going to do our utmost to create the proper atmosphere for a successful election process. We are optimistic that our people will go to vote in this historical event"
Hamas's top candidate
Ten women were among the 62 candidates, including two widows of Hamas leaders killed in Israeli strikes.
Haniyeh urged Palestinians to go to the polls.
"We are going to do our utmost to create the proper atmosphere for a successful election process. We are optimistic that our people will go to vote in this historical event," Haniyeh said.
Hamas is competing in general elections for the first time.
In the last parliamentary polls in 1996, Yasser Arafat selected all Fatah's candidates. This time, a year after Arafat's death, Fatah was pressured into holding primaries by members challenging an Old Guard widely seen as corrupt.