During a surprise visit to Afghanistan on Thursday, Prime Minister Stephen Harper said Canada's role in Afghanistan is "transforming" into one focused on reconstruction and development.

In a speech at the base in Kandahar, Harper said Canada did not come to Afghanistan to occupy the territory.

"We did not come here as permanent occupiers and we do not measure our success by the length of our stay," Harper said.

Harper, on his third trip to Afghanistan, spent most of his time talking about aid and development, shifting the focus away from crushing the Taliban.

He also thanked Canadian servicemen and women, saying they had "brought hope to those who had none."

"You are helping the Afghan population rebuild this country, which has too long been ravaged by war. Your challenges are numerous, your work is extremely dangerous, and you're making enormous sacrifices. The Canadian population is very proud of you." Harper said.

The Harper government's shift in focus comes at a time when four in 10 Canadians want their troops removed from Afghanistan before the targeted end date of 2011, according to a new Canadian Press Harris-Decima poll.

Forty per cent of those surveyed said the troops should be brought back early, while 46 per cent said the troops should stay until the February 2011 withdrawal approved by Parliament.

Only eight per cent of respondents said Canada should extend its mission in Afghanistan.

The prime minister told the troops the goal now is to help Afghanistan become a "country in control of its own destiny."

Earlier in the day, he toured Kandahar City's Dahla Dam, which is the second-largest in Afghanistan.

Canada is spending $50 million over three years to repair the dam, which had fallen into a state of disrepair after decades of war.

"The dam project will supply drinking water to a large part of the Kandahar population. This project will generate 10,000 seasonal jobs, and it will build people's confidence in the future." Harper said.

Harper also announced Canadian funding for a UNICEF project that will provide an education for nearly 20,000 boys and girls in Kandahar.

Canada currently has about 2,700 troops in Afghanistan, mostly in the south.

Meanwhile, thousands of American troops are being deployed in Afghanistan to fight an emboldened Taliban.

Some 200 newly deployed Marines and sailors are arriving each day as part of the buildup of 21,000 new U.S. troops to add to the 38,000 already in place.

Taliban forces show few signs of backing down as the U.S. increases its forces. This was underscored by the confrontation with American troops this week in the western Farah Province that resulted in the deaths of dozens of Afghan civilians.

But the bolstering of NATO troop levels could likely result in more violence, said Chief of Defence Staff Gen. Walter Natynczyk, who accompanied the prime minister on his visit.

"When you bring in a lot more forces with the purpose of interdicting the Taliban roots coming in out of the country, and you block that, there will be activity," Natynczyk predicted.

"There will be violence in those areas."

Natynczyk and Ron Hoffmann, Canada's ambassador to Afghanistan, both said Thursday that Canada and other NATO countries initially did not deploy enough soldiers to provide adequate security in the Kandahar region for aid efforts.

"There has not been sufficient forces on the ground to do this job," Natynczyk said. "We've been trying to do this job with about 40,000 troops. That is totally insufficient."

The prime minister paid homage to the 118 soldiers, plus diplomat Glyn Berry, who have died while serving in Afghanistan since the mission began in 2002.

"Canada has paid dearly for this mission with our most precious asset, our beloved sons and daughters. We will never forget our compatriots who lost their lives to protect freedom. "Harper said.

Canada's combat role in Afghanistan is scheduled to end in 2011 and is expected to be replaced by a smaller force that may include police and army trainers and a provincial reconstruction team.

The prime minister has now left Afghanistan.

With files from the Canadian Press