At least 28 people have died in a suicide and gun attack on a government compound in Kabul, officials say.
At least 20 others were injured during the siege at the Afghan ministry of public works in Kabul.
Hundreds of employees were trapped inside the building at the time – and some reportedly jumped to safety.
It is not immediately clear who carried out the attack. Both the Islamic State group and Taliban have carried similar attacks in the past.
The incident reportedly started with a suicide car bomb blast near the building’s entrance, before gunmen stormed inside.
People in nearby buildings reportedly locked themselves in their offices for safety, a witness told the Reuters news agency.
Trump’s withdrawal ‘ignores dangerous threat’
Why Afghanistan is more dangerous than ever
Interior ministry spokesman Najib Danish said that more than 350 people were eventually freed from the public works office.
He warned the numbers of dead and injured may change, and said an Afghan police officer was among those killed.
Three attackers were also shot dead.
The violence comes after a tumultuous few days for Afghanistan’s political stability.
Last week it was reported that the US planned to drastically reduce its military presence in the country, shortly after Mr Trump announced an entire withdrawal from Syria.
On Sunday, Afghan President Ashraf Ghani replaced his defence and interior ministers with hard-line opponents of the Taliban who used to work for the country’s intelligence agency.