President Ashraf Ghani sacked Afghanistan's defence and interior ministers and the army chief of staff as security forces suffer increasing casualties in fighting with Taliban insurgents.
The changes, announced on Saturday, came as security forces fight the Taliban in 28 of 34 provinces, with the insurgents claiming more territory in recent weeks.
Bismillah Mohammadi was appointed as caretaker defence minister to replace Asadullah Khalid, who had recently returned to Afghanistan after a prolonged absence for illness, while Abdul Mirzakwal was appointed interior minister in place of Hayatullah Hayat.
A senior commander under late anti-Soviet resistance hero Ahmad Massoud, Mr Mohammadi had a long military career and served as interior minister, defence minister and army chief of staff in the government of former president Hamid Karzai.
General Wali Ahmadzai was appointed as chief of army staff, replacing General Yasin Zia, the presidential palace said.
On Friday, 24 Afghan special forces soldiers were killed and dozens wounded in a battle to retake a district captured by the Taliban in northern Faryab province, security officials said.
The Taliban have staged a months-long campaign to expand their influence across the country as the US withdraws troops under a peace plan agreed with the Taliban last year.
The attacks continued despite the start of direct peace talks between the insurgents and the government in September as part of the US-Taliban agreement.
The Taliban seized at least 30 districts since US President Joe Biden announced plans in April to pull out all US troops by September 11, extending the originally agreed withdrawal deadline of May 1.
The Taliban said on Sunday that they remain committed to the peace talks but insisted that a "genuine Islamic system" was the only way to end the war in Afghanistan and ensure people's rights, including those of women.
"Our very participation in the negotiations... indicates openly that we believe in resolving issues through understanding," Taliban co-founder and deputy leader Abdul Baradar said.
Afghans have grown increasingly fearful for the future after a months-long deadlock in the negotiations and increasing attacks by the Taliban.
Fears are also growing that if the hardline group returns to power, they will reimpose their harsh version of Sharia, under which girls were banned from school and women accused of crimes such as adultery were stoned to death in stadiums.
Mr Baradar said the only way to end the conflict in Afghanistan was to establish an Islamic system after the departure of all foreign forces.
He acknowledged the fears among Afghans and abroad about the kind of system that would emerge, and its impact on women, saying this was an issue "within the ambit of the intra-Afghan negotiations".
The rights of all Afghans including women would be accommodated in the system according to "the glorious religion of Islam" and Afghan traditions, he said.
World Refugee Day 2021: Afghan refugees in Peshawar
But there are fears that the Taliban's interpretation of rights will clash with the changes in Afghan society since the US-led invasion that toppled their regime in 2001.
In May, a US intelligence report said the gains in women's rights over the past two decades would be lost if the militants returned to power.
The growing fear and uncertainty about the future has forced many Afghans to try to leave, including thousands of men and women who fear reprisals because they worked with foreign forces.
Mr Baradar called on Afghan youth to not leave the country, and stressed that the Taliban would ensure that minorities, humanitarian organisations and diplomats had nothing to fear.
Mr Ghani's spokesman said the Taliban leader's statement was an attempt to trick Afghans.
“They are not sincere in their remarks. They only want to deceive the people of Afghanistan,” Mohammad Amiri said.
In his statement on Saturday, Mr Ghani called on the Taliban to make a choice between peace and enmity with the government.
"If they choose enmity then the people will respond to them decisively," he said.
He blamed the Taliban for starting the war and accused them of failing to come up with a plan to establish peace.
"As officials of a legitimate government, we are committed to all the humanitarian laws in the war, but the Taliban are violating these laws and are destroying Afghanistan," he said.