"Thank God there are no injuries," he added, confirming that Haniya was inside at the time but unharmed.
"Hamas has decided to punish the attackers and the killers and it will not be reluctant to punish them without any mercy."
It was the second time since Monday that Haniya had come under attack, a shooting at his office on Monday interrupted a cabinet meeting but caused no casualties.
Several mortar bombs also struck the president's compound in Gaza City, an officer in the Abbas's presidential guard said on Tuesday.
Fatah has threatened to quit the Palestinian unity government after Abbas accused Hamas officials of planning a coup.
"All information and events on the ground in Gaza confirm that there is a group in the Hamas movement, including political and military leaders, that are planning to carry out a coup against the Palestinian legitimacy," the president's office said in a statement.
The statement accused Hamas members of "believing they can control the Gaza Strip through force".
Abbas has called for an immediate ceasefire and for all parties to begin dialogue. 'New chapter'
"For the president to make such a declaration does signal a new chapter in this Hamas-Fatah violence," Nour Odeh, Al Jazeera's correspondent in Gaza, said.
"The situation does not seem to be reaching a solution, it seems to be heading further and further away from political dialogue."
|At least 18 people have been killed since |
the fighting escalated on Monday [EPA]
Meanwhile, at a hospital in the southern Gaza town of Khan Yunis a gunbattle broke out between armed supporters of Hamas and Fatah.
Hamas fighters reportedly controlled the roof of the European Hospital and Fatah-allied security forces took up positions nearby.
"[Medical officials] are appealing to gunmen from all sides to steer away from medical services, institutions and ambulances and allow them to do their work," Nour Odeh said.
At least 18 people have been killed in internal fighting since Monday morning in some of the fiercest fighting since Hamas beat Fatah in elections 18 months ago. 'Military zone'
The armed wing of Hamas has threatened to storm security headquarters controlled by Fatah unless they are vacated. The police force was exempt from the demand, although it is dominated by Fatah members it falls under the Hamas-led interior ministry.
Earlier the group had declared the central Gaza Strip a "closed military zone".
"Stay at home and you will be safe," the Izz al-Din al-Qassam Brigades warned Fatah fighters in a radio announcement.
The factional fighting spread to the West Bank city of Ramallah as presidential guards stormed Hamas-controlled al-Aqsa Television and seized quipment, Palestinian security sources said.
The raid came after two television employees were abducted and their set on fire overnight. Palestine TV blamed Hamas for the raid.
Fighters also renewed rocket attacks on southern Israel, three Israelis in the town of Sderot were lightly injured, an Israeli medic said.
Israel launched an air strike into the northern Gaza Strip after the Islamic Jihad group claimed responsibility for the attack.