One of the main Hamas leaders in Gaza on Wednesday said it was imperative that the factions reserved their fire for their common enemy, Israel.
"The Hamas movement announces an end to all tension and threats in the street," Ismail Haniya told reporters.
"We must conserve our weapons for use only against the occupation... Hamas is not the enemy of the PA (Palestinian Authority) and Fatah," he added.
Haniya confirmed that the movement was working with Fatah leaders to end the tension and remove from the streets armed men from both factions.
Prisoner Affairs Minister Sufian Abu Zaydah, a senior member of Fatah who hails from northern Gaza, said both movements had agreed to "cease all activity that would increase tension between the two sides."
Fatah militants members patrol
in Gaza after clashes on 19 July
"These painful incidents have produced no winners, only losers," he said after the agreement.
Palestinian Prime Minister Ahmad Qureia also argued that Israel was the only beneficiary of the internal divisions.
"I believe that the Israelis are pushing us towards an internal war. We must protect ourselves from each other and be aware of these dangers," he said in the West Bank.
"We regret what has happened in Gaza. Hamas is not our enemy. It is the responsibility of the Palestinian Authority to protect all of us and there must be universal respect for the law."
"The Hamas movement announces an end to all tension and threats in the street"
At least seven people were wounded in the exchanges of fire with bodyguards after the attacks on the home of preventive security chief Rashid Abu Shbak and the head of Fatah in Gaza, Abd Allah Franji, security and Hamas sources said.
While the security sources accused members of Hamas' armed wing, the Izz al-Din al-Qassam Brigades, of initiating the latest violence, Hamas said the shooting had been started by the security services.
Both attacks happened around dawn in the Tal al-Hawa neighbourhood of southern Gaza City.
The exchanges had imperilled a tentative agreement reached on Tuesday night between members of Hamas and Fatah to stop targeting each other.
Jewish settlers have stabbed a Palestinian boy to death in the Israeli-occupied West Bank, witnesses said.
They said the 12-year-old was ambushed on Wednesday by several settlers near his home at Qaryot village outside the Palestinian-ruled city of Nablus. He was stabbed 11 times, paramedics said.
Palestinians who seek statehood in the West Bank and Gaza Strip have complained of frequent harassment and attacks by settlers during four and a half years of fighting.
About 240,000 settlers live in settlements among 3.6 million Palestinians.
An Israeli police spokesman said the Qaryot stabbing was under investigation.