Alleged Taliban fighters and other militants stand handcuffed while being presented to the media at a police headquarters in Jalalabad on March 6, 2018. 
Afghan police said over 17 alleged Taliban militants including two Pakistani nationals were arrested during a five-week operation in Nangarhar province. / AFP PHOTO / NOORULLAH SHIRZADA        (Photo credit should read NOORULLAH SHIRZADA/AFP/Getty Images)
PHOTO: NOORULLAH SHIRZADA/AFP/AFP/Getty Images
Alleged Taliban fighters and other militants stand handcuffed while being presented to the media at a police headquarters in Jalalabad on March 6, 2018. Afghan police said over 17 alleged Taliban militants including two Pakistani nationals were arrested during a five-week operation in Nangarhar province. / AFP PHOTO / NOORULLAH SHIRZADA (Photo credit should read NOORULLAH SHIRZADA/AFP/Getty Images)
Now playing
01:21
The Taliban: How it began, and what it wants
PHOTO: CNN
Now playing
00:50
Pence: Proud of US troops in Afghanistan
Now playing
00:50
Trump on Afghanistan plan: 'Attack we will'
US President Donald Trump speaks during his address to the nation from Joint Base Myer-Henderson Hall in Arlington, Virginia, on August 21, 2017.
Trump said a rapid Afghan exit would leave 'vacuum' for terrorists. / AFP PHOTO / Nicholas Kamm        (Photo credit should read NICHOLAS KAMM/AFP/Getty Images)
PHOTO: NICHOLAS KAMM/AFP/Getty Images
US President Donald Trump speaks during his address to the nation from Joint Base Myer-Henderson Hall in Arlington, Virginia, on August 21, 2017. Trump said a rapid Afghan exit would leave 'vacuum' for terrorists. / AFP PHOTO / Nicholas Kamm (Photo credit should read NICHOLAS KAMM/AFP/Getty Images)
Now playing
02:08
The pillars of Trump's Afghanistan strategy
CAMP BLESSING, AFGHANISTAN - OCTOBER 22:  Artilerymen await coordinates before firing a 155mm Howlitzer on a Taliban position October 22, 2008 from Camp Blessing in the Kunar Province of eastern Afghanistan. Their unit, Charlie Battery, 3rd Battalion of the 321 Field Artilery, has fired more than 5,900 shells since it deployed to Afghanistan less than a year ago, making it the busiest artilery unit in the U.S. Army, according to to military officers. They most often fire in support of Army infantry units battling Taliban insurgents in the nearby Korengal Valley, site of some of the heaviest fighting in Afghanistan.  (Photo by John Moore/Getty Images)
PHOTO: John Moore/Getty Images
CAMP BLESSING, AFGHANISTAN - OCTOBER 22: Artilerymen await coordinates before firing a 155mm Howlitzer on a Taliban position October 22, 2008 from Camp Blessing in the Kunar Province of eastern Afghanistan. Their unit, Charlie Battery, 3rd Battalion of the 321 Field Artilery, has fired more than 5,900 shells since it deployed to Afghanistan less than a year ago, making it the busiest artilery unit in the U.S. Army, according to to military officers. They most often fire in support of Army infantry units battling Taliban insurgents in the nearby Korengal Valley, site of some of the heaviest fighting in Afghanistan. (Photo by John Moore/Getty Images)
Now playing
00:54
Trump: US in Afghanistan to kill terrorists
US President Donald Trump speaks during his address to the nation from Joint Base Myer-Henderson Hall in Arlington, Virginia, on August 21, 2017.
Trump warned Monday that a hasty exit from Afghanistan would create a "vacuum" that would benefit America's jihadist foes, in a major policy address on his strategy in the 16-year conflict. / AFP PHOTO / Nicholas Kamm        (Photo credit should read NICHOLAS KAMM/AFP/Getty Images)
PHOTO: NICHOLAS KAMM/AFP/Getty Images
US President Donald Trump speaks during his address to the nation from Joint Base Myer-Henderson Hall in Arlington, Virginia, on August 21, 2017. Trump warned Monday that a hasty exit from Afghanistan would create a "vacuum" that would benefit America's jihadist foes, in a major policy address on his strategy in the 16-year conflict. / AFP PHOTO / Nicholas Kamm (Photo credit should read NICHOLAS KAMM/AFP/Getty Images)
Now playing
00:42
Trump calls terrorists 'losers'
President Donald Trump speaks at Fort Myer in Arlington Va., Monday, Aug. 21, 2017, during a Presidential Address to the Nation about a strategy he believes will best position the U.S. to eventually declare victory in Afghanistan. (AP Photo/Carolyn Kaster)
PHOTO: Carolyn Kaster/AP
President Donald Trump speaks at Fort Myer in Arlington Va., Monday, Aug. 21, 2017, during a Presidential Address to the Nation about a strategy he believes will best position the U.S. to eventually declare victory in Afghanistan. (AP Photo/Carolyn Kaster)
Now playing
01:21
Trump: Our support is not a blank check
Now playing
00:45
Trump acknowledges flip-flop on Afghanistan
PHOTO: POOL
Now playing
01:04
Trump: Love for America requires love for all
president trump afghanistan war plan troop address_00003227.jpg
PHOTO: CNN
president trump afghanistan war plan troop address_00003227.jpg
Now playing
01:34
Trump: We produce a special class of heroes
US President Donald Trump walks by as reporters shout questions to him upon his arrival on the South Lawn at the White House on August 14, 2017 in Washington, DC. Later today President Trump will be meeting from Attorney General Jeff Sessions and FBI Director Christopher Wray regarding this weekendÕs events in Charlottesville, Virginia. (Mark Wilson/Getty Images)
PHOTO: Mark Wilson/Getty Images
US President Donald Trump walks by as reporters shout questions to him upon his arrival on the South Lawn at the White House on August 14, 2017 in Washington, DC. Later today President Trump will be meeting from Attorney General Jeff Sessions and FBI Director Christopher Wray regarding this weekendÕs events in Charlottesville, Virginia. (Mark Wilson/Getty Images)
Now playing
02:24
Will Trump send more troops to Afghanistan?
WASHINGTON, DC - JUNE 13:  U.S. Defense Secretary James Mattis testifies before the Senate Armed Services Committee during a hearing in the Dirksen Senate Office Building on Capitol Hill June 13, 2017 in Washington, DC. Mattis and other Pentagon leaders testified about the proposed FY2018 National Defense Authorization Budget Request.  (Photo by Chip Somodevilla/Getty Images)
PHOTO: Chip Somodevilla/Getty Images
WASHINGTON, DC - JUNE 13: U.S. Defense Secretary James Mattis testifies before the Senate Armed Services Committee during a hearing in the Dirksen Senate Office Building on Capitol Hill June 13, 2017 in Washington, DC. Mattis and other Pentagon leaders testified about the proposed FY2018 National Defense Authorization Budget Request. (Photo by Chip Somodevilla/Getty Images)
Now playing
01:25
Mattis: New Afghanistan strategy decided
PHOTO: Getty Images
Now playing
01:27
US troops in Afghanistan: A history (2017)
An injured man is transported after a car bomb attack in western Kabul, Afghanistan, on Monday, July 24.
PHOTO: WAKIL KOHSAR/AFP/Getty Images
An injured man is transported after a car bomb attack in western Kabul, Afghanistan, on Monday, July 24.
Now playing
00:46
Dozens killed in Kabul car bombing
PHOTO: CNN
Now playing
02:52
Marines remaining in Afghanistan face hardship
(CNN) —  

Afghan President Ashraf Ghani accepted the resignation of his national security adviser but refused the resignations of three other security officials as the country battles the Taliban.

“Today the ministers of defense, interior affairs and the director of the national directorate of security presented their resignations to the president. The President did not accept their resignations and asked them to continue in their jobs and gave them necessary guidance for the improvement of security situation,” the President’s office tweeted Sunday.

However, Ghani accepted National Security Adviser Mohammad Hanif Atmar’s resignation, replacing him with the nation’s ambassador to the US, Hamdullah Mohib, the president’s spokesman, Haroon Chakhansuri said.

Afghanistan’s TOLO News channel quoted Atmar as saying he resigned over “serious differences over policies and approaches at the top level of government.”

Ghani said accepting Atmar’s resignation had been “difficult” but that it was “for the benefit of the country,” TOLO reported. Mohib, 35, took over as national security adviser Sunday morning.

In May, Mohib wrote an opinion article for CNN after a terror attack on a cricket match in his hometown of Jalalabad that had been organized to celebrate peace and unity during Ramadan. In the article, he described his hopes for a peace that would transcend political and ethnic divisions, saying: “My generation envisions a different Afghanistan.”

Deadly attacks

For now, violence continues in Afghanistan, with a string of deadly attacks this month.

On August 10, the Taliban launched a brazen attack on the strategic city of Ghazni, south of the capital Kabul, seizing key buildings and trading fire with security forces.

At least 150 people were killed and 40 injured, the majority of them Afghan security forces.

The Taliban had last attacked a major urban center in 2015 and CNN’s Nick Paton Walsh described the assault on Ghazni as the militant group’s “most serious challenge to the authority of Afghanistan’s government in three years.”

“The Afghan government has said it wants to control the territory in which 80% of the population lives by the end of 2019,” Paton Walsh wrote. “It currently controls 65%, up from 64% this time last year.

On August 14, 39 soldiers died in Baghlan province when the Taliban overran their base. And 17 troops were also killed when their base in Faryab was also overrun.

The following day, at least 34 people were killed in a suicide attack targeting an education center in Kabul. A Taliban spokesman denied responsibility for that attack.

Push for peace

On August 19, Ghani offered a month-long ceasefire with the Taliban.

The two sides had a brief truce in June and Ghani said then that the government was looking to engage in peace talks with the Taliban and hoped to convert it to a political group.

The Taliban have been waging a bitter fight in Afghanistan, with the ultimate goal of ruling the country and imposing its strict interpretation of Islamic law. The group controlled Afghanistan until its 2001 ouster by the US-led coalition that invaded following the 9/11 attacks.

In recent years, a resurgent Taliban have taken control of significant swaths of the country and raised questions about the Afghan government’s ability to protect the country.

The Taliban grew out of the US and Saudi-backed mujahideen movement that fought a bloody guerrilla war against the Soviet Union after that country invaded and occupied Afghanistan in 1979.

The Taliban are formally banned in Russia, but in recent months Moscow has stepped up contact with the group. Russian Foreign Minister Sergey Lavrov said last Tuesday that representatives of the Taliban would take part in talks in Moscow next month on the future of Afghanistan.