The two sides also agreed to form a joint operations room with the Fatah-led security forces to respond quickly to any outbreaks of violence, the official said, speaking on condition of anonymity because he was not authorized to speak to the media.
However, this new agreement did not last long.
Two Fatah activists were killed early Wednesday morning during an exchange of fire with Hamas activists in Gaza.
Shooting continued between the two sides throughout the night despite Abbas and Haniyehs' call for a hold on fire. In another incident Wednesday morning, seven officers in Jabalya were injured by Hamas fire.
Earleir Tuesday, a fierce gun battle between rival Fatah and Hamas forces erupted outside Gaza's main hospital, sparking a day of factional violence that sent students diving for cover in their classrooms and brought life in much of Gaza to a standstill.
Six people were killed and at least 18 were wounded in the violence, which swept away the remains of a tattered truce meant to end a week of fighting that has turned the Gaza Strip into a war zone.
Automatic gunfire echoed throughout the nearly empty streets of Gaza City, and a Fatah security installation was attacked with mortar fire. Masked Hamas gunmen set up makeshift checkpoints on main roads, forces from both sides took up strategic positions and terrified residents shut themselves indoors.
"It's a real war. Since the morning, I've been praying to God that this is going to end," said Suleiman Tuman, a 53-year-old shopkeeper who was trapped in his Gaza City grocery store by the fighting.
"Both sides used to fight the Israelis together. Now they are directing their weapons toward each other and we're in the middle," he said. "Both sides are responsible for this war."
In a televised speech, Prime Minister Ismail Haniyeh of Hamas called for an end to the infighting and urged the warring factions to focus their attention on Israel.
"This nation, this people, will be united in front of the occupation and aggression and will not be engaged, despite the wounds of the past few days, in internal fighting," he said.
Hamas and Fatah have been locked in a power struggle since the Islamic group defeated Fatah in legislative elections in January. Fatah, which seeks peace with Israel, controls the presidency, while the radical Hamas, which is committed to Israel's destruction, controls parliament and the Palestinian Cabinet.
Abbas calls for calm
The fighting began a week ago and intensified over the weekend, when President Mahmoud Abbas announced a plan to call early elections as a way to end the political impasse. Hamas has condemned the plan as a coup. In all, 14 people have died in the clashes, making it one of the deadliest bouts of Palestinian infighting ever.
Abbas called for calm. "I call on everyone without exception to stop the shooting, the murdering and all related operations. I emphasize that dialogue is the only way to achieve our national goals," he said in a statement.
In his wide-ranging, 90-minute speech, Haniyeh blamed Abbas for the violence and political deadlock.
But he also made conciliatory gestures to Abbas. "We have to show self-restraint and dialogue to resolve our differences," he said. "I am calling on everyone to calm down and ease the tensions."
As a first step toward ending the violence, he urged his interior minister to convene a meeting of rival security chiefs later Tuesday to discuss ways to calm the situation.
Jordan's King Abdullah II and the head of the 57-national Organization of Islamic Conference attempted to intervene. Abdullah invited Abbas and Haniyeh to Amman to work out their differences, while OIC chief Ekmeleddin Ihsanoglu shuttled between the West Bank and Gaza talking to the rivals.
"We have some practical ideas to deal with the crisis situation," he said after meeting Abbas. "There are some positive steps. We hope they will be taken."
Hamas spokesman Fawzi Barhoum said the group would consider the Jordanian king's offer to mediate. Abbas' office said he spoke with the king, but gave no further details.
Sunday night's truce declaration had brought a brief ebb in the fighting. But after nightfall Monday, it escalated.
Gaza resident: We are scared to death
The heavy fighting began early Tuesday at Gaza's Shifa hospital shortly after a member of the Fatah-controlled intelligence service, escorted by two armed colleagues, arrived with a broken leg, Fatah officials said.
Hamas militiamen guarding the hospital blocked the armed men from entering and tried to arrest them. When more Fatah forces arrived, they were fired upon, sparking the gunfight, the Fatah officials said.
Hamas accused Fatah of storming the hospital, and said a 23-year-old member of a Hamas police unit was killed. It also said one of its men was kidnapped.
The battle raged for nearly an hour, sending children scurrying for cover as they made their way to school and frustrating hospital staff.
"We as medical staff are unable to do our work ... in these circumstances while they are shooting and bombing everywhere," Dr. Juma Al Saqqa, director of Shifa's emergency department, told Israel's Channel 2 TV.
The fighting spread to one of the main offices of the intelligence service, which was attacked by mortars and grenades, security officials said.
Hospital officials said two pro-Fatah security men in a parked vehicle were killed in another gunbattle, and five schoolchildren were wounded by stray gunfire.
"We are scared to death. ... We don't know where to go," said Jamal Khalifa, 13, in the Sheik Radwan neighborhood who was forced to seek cover at a gas station. "Bullets were flying in all directions while I was leaving the school and I saw a child falling down."
A Fatah security official was kidnapped and killed by Hamas gunmen, Fatah officials said, and a Hamas militiaman was killed in a clash with the pro-Fatah intelligence service. The car of the governor of northern Gaza, prominent Fatah loyalist Ismail Abu Shamallah, was hit by gunfire. He escaped injury.
Hamas and Fatah officials said they remained committed to the truce, and accused each other of violating it.
"Hamas is abiding by the ceasefire," said spokesman Ismail Radwan. "The problem is that not all of Fatah's militias are participating in this decision."
Mediator Ibrahim Abu al-Najah appealed for calm. "What is going on is a violation and sabotage and I have called on both parties to shoulder their responsibility and to end what is going on in the streets," he said.
Tensions have been high since Abbas' efforts to form a moderate unity government with Hamas collapsed last month. Abbas had sought a coalition in hopes of ending international sanctions against the Hamas-led government, which has been isolated due to its refusal to recognize Israel.
Ali Waked and Reuters contributed to the report