ISIL (the Islamic State of Iraq and the Levant group, also known as ISIS) claimed responsibility for the attack in a brief statement carried by its Aamaq website.
Three policemen were injured after one suspected militant detonated an explosive device to block their entry into the building and two other policemen were injured during the exchange of fire that followed.
At least 23 Egyptian soldiers were killed when suicide vehicle bombs tore through two military checkpoints in North Sinai in July, in one of the bloodiest assaults on security forces in years.
At least 15 Egyptian security personnel were killed in North Sinai when their convoy was ambushed by suspected Islamic State militants, in one of the deadliest attacks on police in the restive area this year.
When the police forces approached to the apartment, terrorists opened fire on them, the official said.
Hillary Blames Women's March for Loss Too
Hillary Clinton was so confident she'd become the first female president of the United States that she had only drafted one Election Day speech: for victory.
Israeli Jets 'Hit Syrian Chemical Site'
Israeli fighter jets have struck a military facility in western Syria, killing two people, according to a Syrian commander. Unconfirmed Arab media reports say a chemical weapons production facility was hit in the attack.
Terrell Owens Will Be On ABC's 'Dancing With The Stars'
The Shark Tank star is a longshot, but we're glad to see her follow in the footsteps of Mark Cuban and Robert Herjavec. ABC's " Dancing With The Stars " announced the cast for its 25th season on air on Wednesday.
Two police lieutenants were among the dead.
At least 26 Egyptian soldiers were killed or wounded on July 7, 2017, in attacks on checkpoints in the Sinai Peninsula.
The attack took place about 30 kilometers (nearly 19 miles) west of el-Arish in northern Sinai, the epicenter of a long-running insurgency now led by an IS affiliate.
Private newspaper al-Masry al-Youm, citing security sources, reported that the slain extremists were from the self-styled Hasm group, which authorities accuse of being the armed wing of the now-outlawed Muslim Brotherhood. One of the militants, they said, died when an explosive device he meant to use against the policemen went off prematurely, killing him instantly.
Today's attack came a day after Egyptian security forces killed 10 terrorists during a raid at their hideouts in a densely populated central Cairo neighbourhood.