KABUL: Four people were killed Saturday in an explosion inside the largest US military base in Afghanistan, NATO said, with local officials blaming a suicide attacker posing as a labourer for the major security breach.

The Taliban claimed responsibility for the blast inside the heavily fortified Bagram Airfield, north of Kabul, which wounded 14 others as the insurgents ramp up their nationwide offensive before the onset of winter, when fighting usually ebbs.

The nationalities of those killed and wounded were not immediately known after the explosion, which highlights rising insecurity in Afghanistan nearly two years after US-led NATO forces formally ended their combat operations.

"An explosive device was detonated on Bagram Airfield resulting in multiple casualties. Four people have died in the attack and approximately 14 have been wounded," NATO said in a statement.

"Response teams at Bagram continue to treat the wounded and investigate the incident."

The blast was caused by a suicide attacker who blew himself up near a dining facility inside the base, said Waheed Sediqi, spokesman for the governor of Parwan province where Bagram is located.

"We don't know the identity of victims yet but the attacker was one of the Afghan labourers working there," Sediqi told AFP.

Bagram district governor Abdul Shakoor Quddusi described the explosion around 0100 GMT as "powerful", saying it reverberated across the area.

The United States has around 10,000 troops in Afghanistan, with the largest contingent stationed at the Bagram base.

The brazen attack represents a major security breach inside what is regarded as one of the most heavily guarded military installations in Afghanistan.

- Rising insecurity -

"To the family and friends of those who lost their lives today, we share your loss and our thoughts are with you. We offer you our deepest condolences," said John Nicholson, the top US and NATO commander in Afghanistan.

"For the family and friends of those wounded in today's attack, let me assure you they are receiving the best care possible, and we will keep them in our thoughts today."

Taliban spokesman Zabihullah Mujahid said the insurgent group was behind the suicide attack inside Bagram, claiming it inflicted "heavy casualties on US invaders".

Bagram Airfield has frequently come under attack by Taliban insurgents.

Last December, a motorcycle-riding Taliban suicide bomber killed six US soldiers near the base in one of the deadliest attacks on foreign troops in the country in 2015.

The latest assault came after a powerful Taliban truck bomb struck the German consulate in Afghanistan's northern Mazar-i-Sharif city late Thursday, killing at least six people and wounding more than 100 others.

The uptick in attacks against Western targets comes just days after a bitter US presidential election.

Afghanistan got scarcely a passing mention in the election campaign -- even though the situation there will be an urgent matter for the new president.

President-elect Donald Trump is set to inherit America's longest war with no end in sight.