Kabul, Afghanistan (CNN) -- U.S. Secretary of Defense Robert Gates made a surprise visit to Afghanistan Tuesday to meet with officials and deliver a pat on the back to American troops slugging it out with militants there for more than nine years.
He touched down at Bagram Air Base in a stop made just days after U.S. President Barack Obama's trip to the country and on the same day British Prime Minister David Cameron was traveling there.
Later, he landed at Forward Operating Base Joyce in Kunar Province, where he was to speak to troops. The province is in eastern Afghanistan and is in a perilous area along the border with Pakistan.
The visit comes after a trip to Oman, where Gates visited the USS Abraham Lincoln off the coast of the Gulf state and praised crew members for their support of the Afghan war effort. He also met with the country's leaders.
The activity coincides with coalition efforts to ramp up the fight against Taliban militants and ahead of a major U.S. military review of the war in Afghanistan is expected this month.
And, it comes a year after President Barack Obama ordered additional U.S. troops to the country as part of a strategy that could bring some forces home as soon as July 2011. Officials have said the goal is to end combat operations in Afghanistan in 2014.
In September, Gates traveled to Afghanistan to meet with political and military officials -- including Afghan President Hamid Karzai -- and said the United States' relationship with Afghanistan will be a long-term one.
"Americans will still be here after July 2011," Gates said during the September trip. "The president has been very clear that that is the beginning of a process, and the pace will be determined by conditions on the ground in Afghanistan."
But, he said, "the American people need to know we are not still going to be fighting this fight 15 years from now."
Gates was in Afghanistan during Cameron's second visit to the nation in 2010. The British leader said NATO's goal of ending combat operations in Afghanistan and leaving security in local hands by the end of 2014 is "challenging, but it is achievable."
"What I see is actually some grounds for cautious optimism," said Cameron, who cited the continued training of the Afghan National Army and the nation's police force, noting 500 police officers are coming out of a British-run police academy every eight weeks.
NATO has some 150,000 troops in Afghanistan, pressing the fight against the Taliban and al Qaeda. About 9,500 of the forces are British, according to the country's Defence Ministry.
Obama's visit occurred Friday, where he delivered holiday greetings to U.S. troops stationed there and promised continued full support in the war against militants.
It was his second to Afghanistan since he became commander-in-chief. He visited Afghanistan in 2008 as a presidential candidate.
He visited wounded personnel at a hospital, awarded Purple Hearts and met with the surviving members of a platoon that lost six comrades.
Obama had originally planned to travel to Kabul to meet with Karzai and greet U.S. Embassy staffers, but stayed at Bagram because of poor weather. He did, however, speak to Karzai for 15 minutes via secure videoconference.
The president later huddled with National Security Adviser Tom Donilon, Ambassador Karl Eikenberry, and Gen. David Petraeus, the top U.S. commander in Afghanistan.