"Six people have been killed in the blast, including three policemen. The others include a civilian and two unidentified men," a police officer said.
The Interior Ministry issued a statement saying the bomb had been planted by Muslim Brotherhood militants and went off when security forces tried to raid the building.
Al-Haram has been the site of attacks and gunfights since president Mohamed Morsi was overthrown in July 2013 by then Army chief and now President Abdel Fattah al-Sisi.
On Wednesday, gunmen killed five policemen in an attack on a checkpoint in the North Sinai town of El-Arish. Daesh’s Egyptian affiliate, the Sinai Province, took responsibility for the attack.
The Sinai Province is spearheading a deadly insurgency against security forces in the region. Attackers say they are retaliating for a government crackdown targeting Morsi's supporters that has killed hundreds and imprisoned thousands.
Morsi was Egypt's first freely elected president, succeeding longtime autocrat Hosni Mubarak, who was driven from power in 2011. Monday will mark the fifth anniversary of the anti-Mubarak revolt, and Sisi has warned against any form of demonstration on that day.
Morsi's Islamist Muslim Brotherhood movement, labeled a terrorist organization, has called for protests throughout January. The government crackdown has jailed several of the group's top leaders.
The interior ministry also has warned against any "chaos" on Monday, and has boosted security across Egypt, including around the capital's Tahrir Square, where the anti-Mubarak revolt started.