LONDON - British Prime Minister David Cameron confirmed Wednesday that the U.K. will withdraw 500 troops from Afghanistan by the end of 2012, modestly reducing the size of the second largest foreign force in the country to 9,000.

Following a two-day visit to Afghanistan to holds talks with troops, officials and Afghan President Hamid Karzai, Cameron told the House of Commons the withdrawal would take place over the next 17 months.

His announcement follows President Barack Obama's decision last month that 33,000 American troops will leave the country by the end of next summer. About 68,000 U.S. troops will remain.

All international forces will end their combat role by the end of 2014, and the majority will leave -- though a small number of troops are expected to stay behind to continue working on training projects.

"Having taken such a huge share of the burden and having performed so magnificently for a decade now, the country needs to know that there is an end point," Cameron said.

He said that what he insisted was the "growing strength and capability" of Afghanistan's military and police meant Britain's troops were able to begin their exit.

"This reduction reflects the progress that is being made in building up the Afghan national security forces," Cameron told legislators, hours after arriving back from Afghanistan.

Cameron had previously announced that the withdrawal of 420 troops deployed on temporary missions to Afghanistan is under way and will be completed by February. Those personnel are not considered part of Britain's 9,500-strong permanent force, almost all of whom are based in the restive southern Helmand province.

The leader has also scaled back British ambitions for improving Afghanistan's society -- though he insists that aid month will increase as troop numbers decline. The U.K. is providing 178 million pounds ($285 million) in aid money this year.

"From the outset this government has sought to take a more hardheaded, security-based approach to our mission. As I have said, we are not there to build a perfect democracy, still less a model society," Cameron said.

Cameron's visit to the region was marred Monday by the killing of 20-year-old rifleman Scott McLaren, who went missing from a checkpoint in central Helmand and was later found with fatal gunshot wounds.

An investigation is still ongoing to establish exactly how McLaren died.

Cameron said that in a meeting in Kabul late Monday, U.S. Gen. David Petreaus had heaped praise on Afghan security forces' handling of a deadly suicide attack on a luxury hotel in the country's capital.

"Petreaus went out of his way to praise the ability of the Afghan forces in a number of complex operations," Cameron said.

Some analysts say the assault raised doubts about the capability of Afghan forces to handle security. Local troops needed NATO's assistance to end the incident at Kabul's Inter-Continental hotel, in which 20 people including the attackers died.

In a news conference with Cameron on Tuesday in Kabul, Karzai said he hoped that Britain "could continue to help Afghanistan, to build up our infrastructure, build our civil society" at the same time it wound down its military mission.

"While there will be a reduction of troops -- some drastic, some not so drastic -- the process of transition to Afghan authority must go on unhindered and unimpeded," Karzai said.