The Taliban has attacked a civilian compound on the outskirts of Kabul used by foreign security contractors, killing a police officer.

A powerful explosion jolted the Afghan capital at about 1.30am local time on Monday morning, immediately followed by power outages across the city.

Afghan officials did not provide information on the attack for hours, so residents still reeling from a suicide attack a week ago that killed more than 80 people used social media to find out what had happened.

The Taliban issued a lengthy statement claiming that a Mazda truck bomb had targeted the North Gate hotel, which is located in a largely industrial area of the Pul-e-Charkhi neighbourhood on the road out to Bagram airbase.

The hotel, a heavily guarded compound housing private contractors and security companies, was also the scene of an attack in 2013, when a truck bomb detonated outside the gates, followed by five suicide bombers.

A security guard stands at the site of the explosion. Photograph: Mohammad Ismail/Reuters

As day broke, gunfire and occasional explosions rang out over the area where security forces had taken up positions.

“A truck bomb packed with explosives struck the outer wall of the hotel,” Kabul police chief Abdul Rahman Rahimi told AFP.

“Afghan special forces subsequently entered the compound, killing two armed attackers. One policeman also lost his life and three others were wounded,” he said.

In a statement boasting about previous attacks on “American” establishments, a Taliban spokesman claimed there were no civilians in the vicinity. Those claims could not be independently verified as details on casualties from the bomb blast were not immediately available.

A source inside the compound told a New York Times reporter that the attackers did not manage to get inside the compound. About a dozen foreigners had been taken to safe rooms, and nobody inside had suffered more than light injuries, the source said.