Kabul, Afghanistan -- The Pentagon's top official made an unannounced visit to Afghanistan on Monday to meet U.S. commanders and Afghan leaders amid a push for peace with the Taliban. Pat Shanahan, the recently installed acting secretary of defense, said he has no orders to reduce the U.S. troop presence in the country, although officials say that's at the top of the Taliban's list of demands in exploratory peace negotiations.

Shanahan, in his first trip in his new role, said he's encouraged that President Trump's administration is exploring all possibilities for ending the 17-year war, the longest in American history.

But he stressed that peace terms are for the Afghans to decide.

Get Breaking News Delivered to Your Inbox

Thus far, the Taliban have refused to negotiate with the government of President Ashraf Ghani, calling it illegitimate. Washington is trying to break that impasse.

"The Afghans have to decide what Afghanistan looks like. It's not about the U.S., it's about Afghanistan," Shanahan told reporters traveling with him from Washington.

Acting U.S. Defense Secretary Patrick Shanahan arrives in Kabul, Afghanistan for unannounced visit on February 11, 2019 IDREES ALI / REUTERS

The pace of any U.S. troop withdrawal from Afghanistan has been a major point of discussion -- and concern -- given the strength the Taliban still wields and the group's well-established history of hosting terror groups. Almost half the country remains under Taliban control.

The insurgent group claimed last week that the Trump administration had agreed to pull half of the U.S. forces in Afghanistan out of the country in just a couple months. The U.S. denies that any timeline for a withdrawal has been agreed yet with the Taliban, though CBS News senior national security correspondent David Martin reported just before Christmas that the Pentagon had been ordered to start planning the withdrawal of roughly 7,000 troops.

Zalmay Khalilzad, the administration's special envoy for Afghan peace talks, said Friday that although talks are in an early stage, he hopes a deal can be made by July. That's when Afghanistan is scheduled to hold a presidential election.

Shanahan, a former Boeing executive who had never been in Afghanistan until Monday, was scheduled to meet Ghani and other top government officials. TOLOnews, which describes itself on its Twitter page as "Afghanistan's first 24-hour news and current affairs television network," said he'd started the process:

#Acting US Defense Secretary Patrick Shanahan has met with the US Forces and Resolute Support commander in Afghanistan Gen. Austin Scott Miller after arriving unexpectedly in #Afghanistan on Monday. pic.twitter.com/Syy6eDw84E — TOLOnews (@TOLOnews) February 11, 2019

Shanahan took over as acting secretary of defense on Jan. 1 after Jim Mattis submitted his resignation in December. Shanahan had been Mattis' No. 2.

Shanahan's views on the Afghan war are not widely known. He said he would use this week's visit to inform his thinking and to report back to Mr. Trump.

In testimony before Congress last week, Gen. Joseph Votel, the commander of U.S. Central Command, offered a largely optimistic view of Afghanistan, saying the current maneuvering between U.S. and Taliban negotiators is "our first real opportunity for peace and reconciliation since the war began."

Votel noted that the Taliban are still capable of inflicting significant casualties on Afghan government forces. Just last week, the insurgents killed some two dozen Afghan troops in an attack on an army base in northern Kunduz province.

In addition to battling the Taliban, U.S. and coalition forces in Afghanistan are focused on an Islamic State of Iraq and Syria (ISIS) affiliate known as ISIS-Khorasan, comprised of foreign fighters largely from Pakistan. "Left unchecked," Votel said in his report to Congress, ISIS-Khorasan "will continue to grow as a threat to our homeland."

In his remarks to reporters during his flight to Kabul, Shanahan said that although the ISIS presence in Syria "has been decimated," local Syrian security forces are needed to ensure stability. He said ISIS still has a global presence.

"If something hasn't been completely eradicated, there is a risk of it returning," he said.

Mr. Trump has taken an ambivalent approach to Afghanistan, saying his instinct upon entering office in 2017 was to withdraw. Yet he chose instead to add about 3,500 troops in 2017-2018 to bolster the U.S. effort to train and advise Afghan forces. After Mattis resigned in December, Mr. Trump insisted he'd been unhappy with how Mattis handled Afghanistan. Since then, the administration has said it achieved a tentative "framework" for fuller peace negotiations with the Taliban.

"We do not know whether we will achieve an agreement," Mr. Trump said in his State of the Union address to Congress last week, "but we do know that after two decades of war, the hour has come to at least try for peace."