Afghan Defence Minister Abdullah Habibi and the army chief, General Qadam Shah Shahim, resigned on Monday in the wake of an attack at an army base in Balkh that left over 140 soldiers dead.
According to the President's Office, Habibi and Shahim "stepped down with immediate effect" and President Ashraf Ghani has accepted their resignations, it said.
Interior Minister Tariq Shah Bahrami has been appointed the acting Defence Minister and General Sharif Yaftal is the new acting army chief, a statement from the ARG Palace said.
The development follows the attack last Friday at 209 Shaheen Military Corps Headquarters in Mazar-e-Sharif city that also injured about 80 soldiers.
Habibi was appointed in June 2016 and Shahim had been serving as the army chief early 2015, Khaama Press reported.
The attack has led to a widespread outrage in the country with Afghan people asking for the resignations of the officials responsible.
Afghan MPs on Sunday said 209 Shaheen Army Corps Commander Major General Mohmand Katawazai, Balkh Governor Atta Mohammad Noor, Habibi, Shahim, Interior Minister Taj Mohammad Jahid and Head of the National Directorate of Security Masoom Stanekzai must be held accountable for the assault.
Afghanis welcomed the move soon after the news of their resignation broke on social media.
"Ghani also needs to resign," Afghan man Abdulahi said on Facebook.
Another Facebook user, Mardoomdar, said: "It is very good news. How many other youths would have died (had they not resigned)."