(CNN) -- British Prime Minister Gordon Brown paid a surprise visit to Afghanistan on Saturday, thanking his nation's fighting forces for a job "well done."
UK Prime Minister Gordon Brown, pictured here earlier this week, returned from Afghanistan Saturday.
"This has been the most difficult summer in Afghanistan because the Taliban have tried to prevent the elections taking place and I think our forces who I've been meeting today have shown extraordinary courage during this period," Brown said in a televised interview, taped in Afghanistan and aired in Britain.
Brown dropped by Camp Bastion in Helmand province, where the country's service members are based in Afghanistan. Brown was returning to Britain on Saturday.
The troops have been fighting Taliban insurgents in volatile Helmand province. Like their American counterparts, they have suffered many deaths this summer.
In one 10-day stretch in July, 15 British troops were killed, and the casualties have sparked an intense debate in Britain about the country's military role in the war-ravaged country.
The British military last month said an operation it led to clear the Taliban from parts of Afghanistan has succeeded. It was called Operation Panther's Claw and it was designed to flush the Taliban from parts of southern Helmand Province before Afghan elections, which were held last week.
"They know that the reason why we're here and the reason why we're continuing to be here is that our security at home depends on a stable Afghanistan and no return of the Taliban, and no role for al Qaeda in the running of Afghanistan," Brown said in the interview.
In the interview, Brown was optimistic about training about 50,000 Afghan soldiers over the next year.
"Stepping that up means that the Afghans take more responsibility for [their] own affairs," Brown said. "They're backed up by partnering and mentoring done by the British forces and you can see behind you the new equipment we're bringing into the field to back this up."
Brown will not be attending the funeral of U.S. Sen. Ted Kennedy as had been anticipated. Brown's office said the prime minister wanted to attend the funeral but couldn't "because of government business. He has sent his apologies and condolences to the family."
CNN's Ashleigh Nghiem contributed to this report