On an unannounced visit to Afghanistan, President Obama praised U.S. troops Friday and said his administration’s surge over the past year has weakened the Taliban.

The visit came just days before Obama is to receive a comprehensive assessment of the U.S. war effort there, specifically the effects of the surge of 30,000 troops that the president authorized a year ago.

“I wanted to make sure I could spend a little time this holiday with the men and women of the finest fighting force that the world has ever known,” he told a crowd of about 2,000 troops in a hangar at Bagram Air Base.

Obama added, “We said we were going to break the Taliban’s momentum, and that’s what you’re doing.”

Aides said the visit was primarily to thank the troops, but Obama did speak with Afghan President Hamid Karzai by phone. Obama had planned a trip to Kabul to visit the presidential compound, but canceled because of stormy weather.

Obama also met with Gen. David Petraeus, the top commander in Afghanistan, and Karl Eikenberry, the U.S. ambassador to Afghanistan. On a visit to the base hospital, Obama awarded five Purple Hearts to wounded soldiers.

Obama was on the ground in Afghanistan for three hours before flying back to Washington. It was his second trip as president to the nation where U.S. troops have now fought for more than nine years.

The visit occurred amid ongoing tension between Kabul and Washington. A number of documents made public this week by the website WikiLeaks show U.S. officials depicting the Karzai regime as corrupt.

The WikiLeaks documents include Eikenberry referring to Karzai as a “paranoid and weak individual unfamiliar with the basics of nation-building.”