Toronto, Canada (CNN) -- British Prime Minister David Cameron said Friday that British military forces must be out of Afghanistan before the next general election, scheduled to be held in 2015.
"We cannot be there for another five years, having been there for effectively nine years already," he told Sky News. He is in Canada for the G8 and G-20 summits.
Cameron said he preferred "not to deal in too strict timetables," but said the goal is "not a perfect Afghanistan, but some stability in Afghanistan, and the ability of the Afghans themselves to run their country so we can come home."
Even then, though, Britain and Afghanistan must continue to work together, he said. "Britain should have a long-term relationship with Afghanistan, including helping to train and support their troops and their civil society, their government and all sorts of parts of Afghanistan long after the vast bulk of the troops have gone," he said.
Cameron said failure to maintain long-term relations was one reason that British forces are now there.
"In the past, we walked away from countries like Afghanistan and, to an extent, from Pakistan, and allowed them to become the badlands they became," he said.
The 9,500 British forces in Afghanistan are second in number only to the United States in the International Security Assistance Force. Since the start of operations in October 2001, 307 British forces have died in Afghanistan.