In protest against attacks by militant supporters of President Mahmoud Abbas' Fatah, Hamas also closed all of its government ministries in the Palestinian territories.
In the northern West Bank town of Nablus, Deputy Prime Minister Nasser Shaer said Fatah militants shot at his bodyguards as they rode in a government car, injuring two of them. Shaer was not present during the attack. Hospital officials said a Fatah militant was also injured in the fighting.
At Gaza City's main hospital, a 20-minute gunbattle erupted when the family of one of those killed Sunday arrived to retrieve his body.
The Fatah gunmen accompanying the family opened fire on the Hamas militiamen patrolling the hospital, sending patients and doctors running for cover. No one was injured, hospital officials said.
Fatah also enforced a general strike in parts of the West Bank, closing shops and private schools in a show of force against Hamas.
Fatah militants also released a Hamas official in the Finance Ministry they had briefly kidnapped, telling him his abduction was intended to send Hamas a message to end the Gaza violence, Hamas officials said.
Speaking to his Cabinet on Monday, Prime Minister Ismail Haniyeh, of Hamas, said the tension in Gaza had eased, but worried about the West Bank.
"We reiterate to our people to be responsible, not to spread the circle of disagreements and conflict, and not to transfer events to other parts of the nation," he said.
The violence that killed eight people Sunday began when members of the Hamas-led government's 3,500-man militia confronted civil servants, including members of the Fatah-allied security forces, who were protesting the government's inability to pay their wages.
The tense confrontations erupted in running gunbattles that spread across the Gaza Strip, sending civilians fleeing for their lives and turning the center of Gaza City into a battle zone.
Fatah militants quickly followed through on a promise to retaliate for the Gaza violence with attacks of their own in the West Bank, where Hamas is far weaker.
Haniyeh and Palestinian President Mahmoud Abbas, of Fatah, appealed for calm.
"These confrontations have crossed the red line, which we have avoided crossing for four decades," Abbas said in a speech on Palestinian TV.
Abbas called for the security officers to end their protest and for the Hamas militia, which the government formed after Abbas took control of all the official security branches, to leave the streets.
Late Sunday, Interior Minister Said Siyam, who is in charge of the militia, ordered it to withdraw, and by Monday morning, the militiamen had stopped patrolling the streets and pulled back to their bases near government ministries and on some street corners, reducing friction.
In the southern Gaza town of Khan Younis, where the violence began, dozens of official security officers were patrolling the streets to maintain order.
Despite the appeals for calm, militants in Gaza torched the Agricultural Ministry early Monday, and a group of young students in the northern Gaza town of Beit Hanoun stoned the house of a Hamas minister until his bodyguards chased them away by firing in the air.
Amid the violence, Abbas called for the renewal of stalled negotiations for the formation of a national unity government, a move aimed at ending crippling sanctions on the Palestinian Authority. However, the violence dampened hopes for a Hamas-Fatah coalition.
Israel and the West, which view Hamas as a terrorist group, cut off hundreds of millions of dollars in aid and tax transfers to the Palestinian Authority after Hamas took power, making it nearly impossible for the new government to pay its 165,000 workers.
Abbas has tried to end the crisis by pushing Hamas to accept international demands to renounce violence and recognize Israel's right to exist, but the radical Islamic group has refused.
Violence between Fatah and Hamas loyalists plagued Gaza throughout the spring, but largely disappeared when Israel launched a Gaza offensive in late June after Hamas-linked militants captured an Israeli soldier.