Afghan President Hamid Karzai has asked Canadians to stand firm in providing military support to Afghanistan.
Mr Karzai is grateful for the Canadian presence in Afghanistan
In a speech to Canada's parliament he addressed public concerns about Canadian deployment during which 36 soldiers have been killed since 2002.
He said continued Canadian involvement was crucial to prevent terrorism both in Afghanistan and elsewhere.
Canada's PM Stephen Harper confirmed his support: "Canada does not leave a country before achieving success."
Canadian and British forces have borne the brunt of foreign troop casualties in recent months.
Four Canadian soldiers were killed in a blast in the south on Monday - one of three suicide bombings in the country.
Hundreds of people have been killed this year as violence has risen, mainly in southern and eastern Afghanistan.
Mr Karzai received a standing ovation from MPs and senators as he stepped onto the podium to address Canada's parliament.
"I know my visit comes at a time of sadness for a number of families across Canada who have lost loved ones in my country," he said.
But he asked Canadians to maintain their support.
"A democratic nation is not built overnight. Afghanistan's democracy will continue to grow, will continue to develop... but only with the patience and with the continued support of Canada and other members of the international community.
"Helping us into the future is much more valuable than perhaps you can imagine."
The BBC's Lee Carter in Toronto says Mr Karzai will not be meeting the leader of the New Democratic opposition party, Jack Layton, who has called for Canadian troops to be withdrawn from their combat role in Afghanistan.
Mr Layton said that despite repeated attempts to set up a meeting with the Afghan president, none was scheduled.
Mr Karzai arrived in Ottawa a day after addressing the UN General Assembly in New York.
At the UN he called for the destruction of safe havens and elaborate networks operating in the region to recruit, train, finance, arm and deploy terrorists.
But he said military action alone would not stop terrorism in his country.
A recent poll found only 38% of Canadians support their country's military presence in Afghanistan, while 49% want the 2,300 troops hunting Taleban and al-Qaeda militants to withdraw.
Afghanistan is the largest recipient of Canadian foreign aid.