KABUL, Nov. 29 (Xinhua) -- U.S. President Donald Trump paid a surprise visit to Afghanistan on Thursday evening, meeting with his Afghan counterpart Mohammad Ashraf Ghani and spending Thanksgiving with U.S. troops stationed in the country.

It was Trump's first trip to the war-torn country since becoming president.

"In our bilateral meeting, we discussed the important progress we have jointly made in our military efforts in the battlefield, including crushing the Daesh (Islamic State or IS group) in eastern Afghanistan. President Trump appreciated the tireless efforts of the Afghan security forces in this fight," Ghani said on Twitter early on Friday.

During the meeting at Bagram Air Base, the main U.S. and coalition military base, some 50 km north of Kabul, both sides underscored that "if the Taliban are sincere in their commitment to reaching a peace deal, they must accept a ceasefire."

After the meeting, the two presidents joined the U.S. troops and delivered speeches and offered their Thanksgiving greetings, Ghani added.

"We thanked them and their Afghan counterparts for their continued efforts and sacrifices in combating terrorism," he said.

The war in Afghanistan is the longest war in U.S. history. The death toll of U.S. service members has surpassed 2,400 since the United States invaded Afghanistan in 2001.

According to the statistics from the UN Assistance Mission in Afghanistan, 2018 was the deadliest year on record for the Afghan conflict, with a total of 10,993 civilian casualties, including 3,804 civilian deaths.