KABUL (Reuters) - Vice President Mike Pence made an unannounced trip to Afghanistan to meet its leaders and underscore U.S. commitment to the country four months after President Donald Trump agreed to an open-ended war against insurgents here.

Pence arrived on a military plane at Bagram Airfield under the cover of darkness on Thursday night after leaving Washington on Wednesday night. He then flew by helicopter to Kabul, where he met President Ashraf Ghani and Chief Executive Abdullah Abdullah at the presidential palace.

Pence told the leaders he hoped his presence there was tangible evidence that the United States was “here to see this through.”

In a reversal of his campaign call for a swift withdrawal of U.S. forces from Afghanistan, Trump in August pledged a stepped-up military campaign against Taliban insurgents and signaled the United States would send more troops to fight in what is the longest war in its history.

At the end of August, there were some 11,000 U.S. troops in Afghanistan and more have since arrived.

Ghani expressed gratitude to the U.S. government and said Afghanistan’s partnership with the United States was cemented in sacrifice.

Pence told reporters the strategy of increased troops on the ground and greater authorities for military leaders was paying dividends.

“The results are really beginning to become evident around the country,” he said, adding that Ghani and Abdullah had said “they’ve begun to see a sea change in the attitudes among the Taliban.” Pence said their hope was that “eventually the enemy will tire of losing” and be willing to talk peace.

Asked if more troops would be needed, Pence said that would be a decision for Trump in the days ahead.

Slideshow ( 18 images )

Pence said he pressed the Afghan leaders for political reforms and Ghani assured him that an election commission was developing a framework for parliamentary elections in 2018.

Pence had originally planned to travel to Israel and Egypt this week, but he postponed that trip to remain in Washington while Congress passed legislation to overhaul U.S. tax law.

The short visit to Afghanistan, originally part of the Middle East trip, was shrouded in secrecy for security reasons. Reporters traveling with the vice president were asked not to reveal his whereabouts until after the delegation arrived back at the air base from Kabul and Pence had addressed U.S. troops.

Pence almost did not make it to the presidential palace. The helicopters he and others were flying in came close to turning back to Bagram because of poor visibility, but the pilots were able to find a route in the end, a White House official said.

Pence, who coordinated the process that resulted in Trump’s new Afghanistan policy, has been one of the main interlocutors between the White House and the Afghan leadership since Trump entered office in January.

He repeated his promise of U.S. commitment to the region during remarks to troops at Bagram.

“Under President Donald Trump, the armed forces of the United States will remain engaged in Afghanistan until we eliminate the terrorist threat to our homeland, our people once and for all,” Pence said.

Trump’s views of the 16-year-long Afghan conflict have shifted since he came to power.

Slideshow ( 18 images )

As a presidential candidate he called for a swift withdrawal of U.S. forces, which were bogged down through the presidencies of Republican George W. Bush and Democrat Barack Obama after a U.S.-led coalition overthrew the Islamist Taliban government for harboring al Qaeda militants who plotted the Sept. 11, 2001, attacks on New York and Washington.

But Trump, while acknowledging the decision went against his instincts, argued in August that a hasty withdrawal would create a vacuum for Islamic State and al Qaeda to fill.

He declined to set a timeline for withdrawal or outline benchmarks for the new strategy’s success.

Echoing Trump’s comments when he unveiled the new strategy, Pence had sharp words for neighboring Pakistan, which he said had provided safe haven to the Taliban and other groups for too long.

“Those days are over,” Pence said. Pakistan had much to gain from partnering with the United States, and much to lose by harboring “criminals and terrorists,” he said at Bagram.

U.S. troops are involved in training Afghan security forces and carrying out counter-terrorism operations, hoping to reverse gains by the Taliban and prod it to negotiate for peace.

Some 2,400 U.S. forces have died in Afghanistan since the U.S.-led invasion.