Image copyright Reuters Image caption Police and security forces sealed off the area after the blast

A compound housing foreign contractors in the Afghan capital, Kabul, has come under attack from Taliban fighters.

A huge explosion was heard across the city about 01:25 local time on Monday (20:55 GMT Sunday).

Kabul police chief Abdel Rahman Rahimi told the BBC a lorry bomb went off at the gate of the North Gate compound and then two gunmen went inside.

In a gun battle one police officer and both attackers were killed, and the attack is now over, police say.

Three police officers were injured during the gun battle that lasted for several hours, Mr Rahimi told the BBC's Mahfouz Zubaide in Kabul.

No one staying at the compound was injured.

North Gate is mainly used by foreigners. It is a heavily guarded compound, which was attacked by militants three years ago.

Big explosion

Power in parts of Kabul was briefly cut off shortly after the explosion.

"I was about to go to sleep when the explosion happened. The power went off," said local resident Inamullah Khan. "It was a very big explosion. It was very big."

"I've spent eight years in Afghanistan and it was the loudest and the most heavy blast I have ever experienced," said Andreas Wilmers, chief operating officer of Afghanistan Broadcast System.

He said security around Kabul was more relaxed at night.

"The control of the Afghan police, its so-called ring of steel... those checkpoints are basically operational during the day, but in the night they are not really manned," he added.

Last week, two suicide bombers linked to the so-called Islamic State (IS) killed 80 people and wounded 230 more in Kabul.

That attack, followed closely by this one on a heavily guarded compound, will once again raise questions about Afghan intelligence gathering, BBC Afghanistan bureau editor Inayatulhaq Yasini says.