The new U.S. defense secretary, Ashton Carter, says he wants to assure a "lasting accomplishment" in Afghanistan. His remarks were made on an unannounced visit to the country during his first overseas trip as Pentagon chief.

Carter commented Saturday at a news conference shortly after arriving in Kabul. He said he is in Afghanistan to assess how to ensure long-term success of the U.S. mission there. He said U.S. President Barack Obama wants him to make his own assessment about the presence of U.S. troops in Afghanistan and has not ruled out slowing down the expected withdrawal of troops if necessary.

"As President Obama and I discussed in my first meeting with him in the Oval Office earlier this week, just a few days ago, our priority now is to make sure this progress sticks," he said. "That is why President Obama is considering a number of options to reinforce our support for President Ghani's security strategy, including possible changes to the timeline for our drawdown of U.S. troops."

Carter said he will discuss the drawdown, as well as Afghan efforts to fight the Taliban, with Afghan President Ashraf Ghani during his visit. He is also scheduled to meet with U.S. troops.

Carter's visit comes as the U.S. mission in Afghanistan changes from combat to training and advising Afghan forces that have taken responsibility for the country's security.

About 10,000 U.S. troops are in Afghanistan.

Before taking office, Carter told the U.S. Senate he could reconsider plans to pull all U.S. forces out of Afghanistan by the end of the year. But he said that would depend on the security situation.

He also said he would work with U.S. coalition partners to make sure the Islamic State militant group does not expand from the Middle East into Afghanistan.