Rival factions of the ruling Fatah party clashed in a shootout at party headquarters in the Gaza Strip Wednesday, shortly after masked gunmen took over the building, deepening a political crisis ahead of a key election deadline. Three people were wounded. The shootout was the latest - and most serious - incident in a rash of violence in recent days as the party prepares to announce its candidates for Jan. 25 parliamentary elections. Palestinian leader Mahmoud Abbas, along with rival parties, faced a midnight deadline to present the party's candidate list. Abbas held primaries in the West Bank and Gaza Strip in recent weeks to determine who would represent the party in the election. But he decided to cancel the results of the primaries in some areas - including Gaza - due to violence, the burning of ballot boxes and other election violations. He said he would appoint candidates in those areas. The gunmen who occupied the Fatah headquarters Wednesday - taking up position on the building's rooftops, balconies and around the facade - were protesting the appointments, demanding that the primary results be respected. The gunmen were part of the Al Aksa Martyrs' Brigades. A security force headed by the chief bodyguard to Fatah's secretary-general in Gaza rushed to the building, sparking Wednesday's gunbattle. The shooting subsided after several minutes, and dozens of bodyguards and security personnel retook control of the building. Police also took up positions at other buildings that could be targeted, including Abbas' office and residence. The fighting came ahead of a midnight deadline for all parties were to announce their lists of candidates. Underlying the crisis in Fatah is a power struggle between younger activists, led by jailed uprising leader Marwan Barghouti, and movement veterans who have refused to step aside. The young guard has done well in Fatah primaries, and Barghouti is considered the top vote-getter. Barghouti is considering quitting Fatah and running as the head of an independent list if he and his supporters are not given realistic slots on the list, said a Barghouti ally, legislator Hatem Abdel Khader. Several intermediaries were to meet with Barghouti in prison on Wednesday, ahead of his final decision. Barghouti's supporters have put together an alternative list, to be led by Barghouti, should he decide to leave Fatah, Abdel Khader said. Barghouti's departure from Fatah would be a severe blow to the corruption-tainted party, which is trying to fend off a tough challenge by the Islamic militant Hamas. Barghouti has insisted he be given the top slot on the list, and that his allies get realistic spots on the Fatah slate. Competition at the district level is expected to be much tougher, and Barghouti said that's where the outgoing legislators, who served 10 years, should seek re-election. In a compromise presented late Tuesday, Abbas proposed that Barghouti share the top slot in the Fatah list with two old-timers, outgoing Prime Minister Ahmed Qureia and Parliament Speaker Rauhi Fattouh. Abbas also included several veteran Fatah members considered to be corrupt on the slate, according to Palestinian officials. Barghouti, who is a legislator in the outgoing parliament, is serving five life terms in Israel for involvement in attacks that killed four Israelis and a Greek monk. Despite ongoing unrest, the Palestinian central election commission returned to work on Wednesday, a day after halting operations to protest a spate of attacks against its staff. Secretary-General Rami Hamdallah said the commission decided to reopen its offices after Interior Minister Nasser Youssef promised to provide security to election workers. Hamdallah said he personally met with Youssef to discuss the matter.