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.
Much of the building's roof collapsed, causing most of the casualties
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.
- Accra is second most expensive city in the world – Survey
- Complete abandoned E-block if you are frustrated – Akufo-Addo tells Aflao chief
- Shatta Wale remanded in police custody for one week
- Google agrees to integrate Ghana’s GPS into Google map system – Bawumia
- ‘I made a mistake’ – Akufo-Addo apologises for Cape Coast harbour comment
- Ambassador to Italy, Eudora Quartey-Koranteng has died
- Shatta Wale to appear in court today over hoax shooting
- Court refuses appeal challenging NCA’s decision to reduce Joy and Asempa FMs coverage area
- There’s no space for 499 students at Ghana Law School – Akufo-Addo
- Henry Quartey initially didn’t want to be Greater Accra Regional Minister – Akufo-Addo
Europa Conference League: Wins for Rennes, PAOK & Feyenoord
Newcastle United hold talks with ex Roma boss Paulo Fonseca
Be honest about campaign promises that can be fulfilled and those that cannot – Franklin Cudjoe to government
We don’t pay our taxes to Aflao Chief – Ablakwa tells Akufo-Addo
The Queen back at Windsor after hospital stay
Claanti Foundation embarks on breast cancer awareness, screening in Ahafo region
New maternity block at Tatale Health Center yet to be operationlised after 18 months
Accra Sports Stadium and Baba Yara approved by club licensing board
Playback: PM Express discusses state of Ghana’s energy sector
‘The responsibility is mine’ – Mourinho after suffering heaviest managerial defeat against Bodo/Glimt
Medikal reportedly arrested for brandishing a gun
Akufo-Addo’s explanation on E-block project not sufficient – Deputy ranking member on education committee
ICC T20 World Cup Qualifier: Ghana’s qualification hopes dented after defeat to Uganda
Ghana’s high public debt is a concern to investors – Fitch Solutions
Minority to file a motion seeking answers on the state of E-block projects