Ibrahim Abu Najja, head of a high-level committee that includes all the groups, told AFP: "There is an agreement between all armed Palestinian groups for a ceasefire and to end the violence."
The development was confirmed by Ismail Radwan, Hamas spokesman, who told AFP that the ceasefire pact stipulates that "armed men must stop circulating on the streets".
Just before the news of the truce broke, a Fatah spokesman said a colonel in the Palestinian national security service belonging to Fatah was kidnapped and killed on Sunday in the Gaza Strip by Hamas fighters.
Adnan Rhami, 40, was abducted with two bodyguards while driving in the Jabalya camp, after which the masked kidnappers shot him and dumped his body near a hospital, the spokesman said.
It is not known what happened to the bodyguards.
The incident came during a day of violent clashes between Fatah and Hamas supporters after Mahmoud Abbas, the Palestinian president, called for presidential and parliamentary elections to break a political impasse in the Palestinian territories.
Earlier on Sunday, a 19-year-old Palestinian woman was killed after supporters of Abbas's Fatah faction and Hamas clashed outside the presidential compound in Gaza City.
The death was the first civilian casualty since Abbas said the day before he was calling elections to try to end months of impasse during Hamas's rule.
Al Jazeera's correspondent Noura Odeh said a number of mortars had been fired at Abbas's city office.
The fighting came after the ruling Hamas party acccused Fatah of trying to kill the Palestinian foreign minister after shots were earlier fired at his convoy in Gaza City.
Mahmoud al-Zahar was unharmed in the attack.
Gunfire and explosions
The prime minister urged Abbas to give orders to his presidential guard "not to target citizens," as automatic gunfire and loud explosions were heard outside Abbas's official residence.
The guards, backed by members of the al-Aqsa Martyrs Brigades, took control of the Hamas-run agriculture and transport ministries nearby.
Al-Zahar accused Abbas security forces of attempting a "military coup" and demanded the fighters leave the offices or be arrested.
A Palestinian security source said two mortar bombs landed less than 100 metres from Abbas's office injuring five of his presidential guards.
Forces loyal to Hamas and Fatah fought street and rooftop gun battles across Gaza throughout the day.
Residents said it was the heaviest bout of internal fighting in living memory.
Armed men also opened fire at a Fatah rally on Sunday, wounding at least seven people, Palestinian security officials said.
Tens of thousands of people were marching in the northern Gaza Strip in support of Abbas.
|"The government rejects the call for legislative elections as they are unconstitutional and create confusion" |
Palestinian Prime Minister
"We came under fire without any provocation," Amina al-Ghesari, a witness told the Associated Press news agency.
"There were gunmen, we think they were from Hamas, on one of the rooftops. People started running for cover. We were in a peaceful demonstration, and we were on our way home when the shots were fired."
Despite the violence, Abbas has indicated he is determined to push ahead with his plan to dissolve the government and hold early elections.
Ismail Haniya, the Palestinian prime minister, said Hamas would boycott the polls and accused the president of trying to topple the government illegally.
Haniya told a cabinet meeting that the call for early elections was "unconstitutional" and could create further disorder in the Palestinian Territories.
"The government rejects the call for legislative elections as they are unconstitutional and create confusion," he said.
Earlier in the day, in an attack blamed on Hamas, dozens of gunmen raided a presidential guard training camp, killing a member of the elite force.
Palestinian presidential security sources said dozens of Hamas's al-Qassam Brigades members stormed the training centre in Shaikh Ijleen district, south Gaza City, firing mortar shells and rocket-propelled grenades early on Sunday.
|Supporters of Fatah and|
Hamas clashed in Gaza
Al-Qassam Brigades, Hamas's military wing, however, denied responsibility for the attack.