Dozens of Afghan security personnel were killed by Taliban militants who overran a military intelligence base near Kabul, officials have confirmed.
At least 43 people were killed and 54 injured in the attack, the NDS intelligence service told the BBC.
Insurgents blew their way into the base using a car bomb before opening fire. Some reports put the toll at over 100.
It is one of the deadliest attacks on the secret service and follows a string of battlefield setbacks for the army.
Monday’s attack on the National Directorate for Security (NDS) base in central Wardak province came hours before the Taliban held another round of peace talks with US diplomats in Qatar.
Reports say the base in Maidan Shahr, about 30km (19 miles) south-west of Kabul, is a training centre for pro-government militia members.
The militants smashed their way in by detonating a captured Humvee packed with explosives. At least two gunmen then opened fire in the compound.
A second car bombing attempt was foiled by the Afghan security forces and three would-be suicide attackers were killed, the NDS told the BBC.
The Taliban said on Monday they had attacked an Afghan special forces unit and 190 people had been killed. The group often inflates casualty figures from their attacks.
Officials initially acknowledged about 20 deaths but the latest unconfirmed reports say some 70 bodies have so far been pulled from the rubble.
Most casualties were caused by the partial collapse of the building’s roof when it was hit by the force of the Humvee blast.
The Taliban’s power and reach has surged since foreign combat troops left Afghanistan in 2014.
US-led combat operations against the Taliban, the main insurgent group in Afghanistan, officially ended in that year, but some foreign troops remain in the country to provide training and assistance to Afghan forces, who do most of the fighting.
However the US has been carrying out a sustained air bombing campaign since President Trump announced a new strategy in 2017.
The Taliban frequently carries out deadly attacks targeting military bases, soldiers and police and in recent years US and Afghan officials have withheld detailed casualty figures as they are deemed too sensitive.
But late last year, President Ashraf Ghani said more than 28,000 Afghan police and soldiers had been killed since 2015.
Who are the Taliban?
The Taliban emerged in the early 1990s following the withdrawal of Soviet troops from Afghanistan, shortly before the demise of the Soviet Union.
The militants went on to rule Afghanistan from 1996 to 2001, until they were driven from power by US-led troops following the 9/11 attacks, which the US blamed on al-Qaeda militants who were hosted by the Taliban.
In November, Russia hosted a landmark international meeting on Afghanistan in Moscow aimed at kick-starting peace talks.
It was the first time that Taliban militants had attended such an event.