Another bodyguard, the prime minister's son and a political adviser were wounded.
Ismail Rudwan, a Hamas spokesman, said Mohammed Dahlan, a senior Fatah official and politician, was behind the armed attack on Haniya's convoy after it passed through the Rafah border from Egypt into Gaza late on Thursday night.
On Friday, Hamas was celebrating its 19th anniversary.
In Ramallah, the security units loyal to Mahmoud Abbas, the president, and dressed in riot gear, used clubs and rifles to beat back the demonstrators before the shooting broke out.
Rudwan said: "Mohammed Dahlan bears the direct responsibility for the assassination attempt which targeted the prime minister and he bears responsibility for the blood of the martyrs in the incident.
"The dirty hands which assassinated and wounded the bodyguards of the prime minister and attacked the prime minister's convoy will not escape punishment."
Rudwan offered no evidence of Dahlan's involvement. He said the attempt on Haniya's life had been planned in advance and that the perpetrators had received order from foreign parties.
Dahlan was not immediately available to comment. Tawfiq Abu Khoussa, Fatah's spokesman in Gaza and the West Bank, rejected Hamas's accusations.
He said: "Fatah has condemned the incident and is demanding the formation of an official investigation committee."
Rudwan called on Abbas to remove his presidential guard, Force 17, from the streets of the Gaza Strip and from the Rafah crossing.
Abbas has said he "regretted" the attack.
Haniya was returning from a regional tour and had raised an estimated $35 million in aid. Israeli border security prevented him from bringing the money into Gaza.
Hamas security forces later seized control of the crossing, which is regularly closed by Israel leaving thousands of Palestinians stranded in Egypt or stuck within the territory. Twenty people were wounded.
Haniya's convoy sped away after the attack and officials said he was unharmed.