U.S. President Barack Obama rallied the troops in Afghanistan, during a surprise visit to the nation on Friday, saying they are making progress and will succeed in their mission.

Obama flew into Bagram Air Field, north of Kabul, under cover of darkness on an unannounced visit to meet officials and speak with the troops.

Wearing a leather bomber-style jacket, Obama delivered a rousing speech to a large group of boisterous troops. He acknowledged the challenges they face and the losses the U.S. has incurred in the battle, but said they are achieving their objective.

"We said we were going to break the Taliban's momentum and that's what you're doing -- going on the offence, tired of playing defence, targeting their leaders, pushing them out of their strongholds," Obama said.

"Today we can be proud there are fewer areas under Taliban control and more Afghans have a chance to build a more hopeful future."

Obama also apologized for keeping the troops up late into the night and said he wanted to keep his speech short so that he could meet as many people as possible.

Obama also telephoned Afghan President Hamid Karzai after he arrived in Afghanistan. They were supposed to meet in person, but the face-to-face was cancelled due to bad weather.

Since his election, Obama has had a relatively frosty relationship with Karzai, compared to the one under the previous administration of George W. Bush.

Relations have been further strained in recent days, with the WikiLeaks release of classified documents revealing the private, often unflattering opinions U.S. state department officials have of the Afghan leader and his government.

White House officials said the fact the two presidents won't meet in person is of little consequence, especially considering they met during the NATO summit in Lisbon, Portugal last month.

CTV's Paul Workman said Obama was much more upbeat in his message to the troops, compared to the sobering diplomatic cables.

"It was initially planned as an innocent visit, for Obama to go there to say ‘thank you' to the troops for the holiday season," Workman told Power Play on Friday.

"He seemed to enjoy himself, he looked like he liked the idea of being outside Washington and away from all his political troubles."

During his whirlwind three-hour stay, Obama is also expected to hold a briefing with U.S. advisers.

Speaking to reporters on the flight to Afghanistan, U.S. National Security aide Ben Rhodes said the visit has been in the works for more than a month.

Part of the objective was to provide a boost to soldiers who may be missing their families more than usual, with Thanksgiving having just passed and Christmas around the corner.

"It's always tough to serve in harm's way but when you're away from loved ones in the holiday season it's particularly hard, and the president wanted the ability to come out and have some time with them," Rhodes said.

Obama's clandestine jaunt comes amidst growing domestic and international pressure to end the unpopular war. It also comes just days before the White House National Security Council is due to submit to Congress its review of the U.S. military strategy there.

In addition to measuring progress in Afghanistan, the review is also expected to evaluate the state of negotiations with the Taliban, as well as the success of efforts to eliminate terrorist safe havens across the Pakistan border.

Although it is not expected to contain recommendations for alternate policies, U.S. officials have said it might shape how resources are deployed in the region.

This trip is the commander-in-chief's second to the war-torn nation. When Obama last travelled to Kabul in March, he pledged that the partnership between Afghanistan and America would continue.

Just two months earlier, Obama ordered the deployment of an extra 30,000 troops there. He also said they would begin the long process of withdrawal by mid-2011.

But, following the NATO summit in Lisbon last month, Obama said the U.S. would follow their plan to withdraw combat troops by 2014.

With files from The Associated Press