Gen. Austin Scott Miller assumes command of NATO forces in Afghanistan in a ceremony Sunday at Resolute Support Headquarters in Kabul.

KABUL, Afghanistan — Army Gen. Austin Scott Miller, incoming commander of American and NATO troops in Afghanistan, pledged he would ensure Afghanistan would not become a safe haven for terrorists during a change-of-command ceremony Sunday in Kabul.

Miller took over from Army Gen. John Nicholson, who after more than two years in charge, had been the longest-serving U.S. commander of the 17-year war.

Miller assumed command amid reported U.S. efforts to negotiate peace with a resilient Taliban insurgency and as senior military officials have said the Pentagon does not expect an endless large-scale military mission in the country.

“We must ensure terrorists can never use Afghanistan as a safe haven,” Miller told American, NATO and Afghan officials who attended the ceremony.

He takes command of NATO forces in Afghanistan as the country suffers from continued warfare, a devastating drought, and concerns over upcoming parliamentary and presidential elections.

Afghanistan saw a glimpse of peace when the government and the Taliban announced overlapping cease-fires in June, prompting displays nationwide of insurgent and government soldiers hugging and taking selfies.

A second cease-fire offered by Afghan President Ashraf Ghani has yet to be accepted by the Taliban and fighting continues throughout the country. Districts in Faryab and Badakhshan provinces remain under militant pressure, and local officials warn of increasing Taliban threats near major cities such as Kabul and Gardez. The Afghan military, meanwhile, announced 102 Special Forces operations and 11 airstrikes in 11 provinces Saturday.

A decorated Special Operations soldier, Miller previously oversaw the United States’ most secretive commando units as chief of Joint Special Operations Command. The West Point graduate participated in combat operations in Iraq, Afghanistan, Somalia and Bosnia, according to an official bio. As a young captain he led a contingent of the elite Delta Force during the Battle of Mogadishu in 1993.

During his confirmation hearing, Miller said he didn’t foresee an end to the conflict anytime soon.

“I can’t guarantee you any timeline or an end date,” he told the Senate Armed Services Committee earlier in June, adding that withdrawal from Afghanistan could allow extremist groups such as the Islamic State to strengthen and carry out attacks on U.S. soil.

Miller warned lawmakers that withdrawing from Afghanistan would likely mirror the pullout of U.S. troops from Iraq in 2011 — which helped lead to the rise of the Islamic State.

The Pentagon does not expect an enduring large military commitment in Afghanistan, the chairman of the Joint Chiefs of Staff, Marine Gen. Joseph Dunford, told reporters Aug. 28.

The Taliban in recent weeks have launched several high-profile attacks on cities across Afghanistan, leading to the deaths of hundreds of security personnel, destruction in the key city of Ghazni and the capture of several small military bases in northern Afghanistan.

During farewell remarks, Nicholson asked the Taliban to declare a cease-fire and pursue peace talks.

“It’s time for this war in Afghanistan to end,” Nicholson said Sunday. “The time for peace is now.”

Since last summer, Nicholson has overseen the Trump administration’s new strategy for Afghanistan that includes pouring thousands of additional troops into the country, increasing its bombing campaign against the Taliban and pressuring Pakistan to assist in security efforts.

In his speech, Nicholson noted successes such as the growth of the Afghan Air Force and the buildup of the Afghan commando units from 30 companies to 45 in the two years since he took command.

Despite the revamped approach designed to drive Taliban leaders into peace negotiations, the U.S.-backed Afghan government has made “no significant progress” in increasing the percentage of the population living under government control or influence, according to the latest Department of Defense Inspector General report on Afghanistan. The report noted 35 percent of the population lives under Taliban control or in contested areas.

In July, American diplomats, in a reversal of policy in Afghanistan that favored talks between the Taliban and the Kabul government, opened direct negotiations with Taliban representatives, according to media reports.

Miller has said he has spent about four cumulative years serving in Afghanistan over various deployments. In 2001, just months after the 9/11 terrorist attacks that sparked the war, Miller was among the first Americans in Afghanistan. He returned for deployments in 2009 and 2013, most recently leading special operations forces in the country.

Several defense officials, who spoke on condition of anonymity, told Stars and Stripes that the Pentagon expects him to implement an aggressive but analytical style as the top commander in Afghanistan. Miller was at the helm of the Army’s most elite and secretive unit, Delta Force, when it greatly increased its aggressiveness in the war in Iraq - largely in volatile Anbar province, which includes the key cities of Ramadi and Fallujah.

There are about 15,000 U.S. troops in Afghanistan, down from a peak of about 100,000 under President Barack Obama's surge.

Those in the crowd included Gen. Joseph Votel, the commander of U.S. Central Command, former Afghan national security adviser Hanif Atmar, and the man who replaced him, 35-year-old Hamdullah Mohib.

Elsewhere in Afghanistan, Col. Matthew R. Weinshel assumed command of the 101st Combat Aviation Brigade, which provides support through supply, medical evacuation and drone and combat helicopter missions.

“This is really the first time we've seen some hope in respect to some sort of peace and reconciliation,” said Weinshel, who has deployed to Afghanistan five times, including to Kandahar as part of the U.S.’s surge in 2009.

lawrence.jp@stripes.com

Twitter: @jplawrence3