Capt. Nichola Goddard is the first Canadian female combat soldier to be killed in action. ((Canadian Press))

With the latest death of a Canadian soldier fresh in their minds, members of Parliament have voted to approve an extension of the military mission to Afghanistan.

The vote on Wednesday night was close, but with the help of 30 Liberal MPs, the Conservative government prevailed 149-145.It means Canadian soldiers will remain in Afghanistan two years longer than previously planned.

The death of Capt. Nichola Goddard, 26, was reported as the Commons gathered on Wednesday to debate the merits of a government proposal to extend the mission.

A defiant Prime Minister Stephen Harper led off the debate by declaring he would extend the mission by a year, with or without the support of the House, and would be willing to call an election on the issue, putting the ultimate decision directly into the hands of Canadians.

"We cannot walk away quickly," Harper told the House."If we need further efforts or further mandate to go ahead into the future, we will go so alone and go to the Canadian people to get that mandate."

Harper said the mission is in Canada's interests and important in the fight against terrorism.

"The events of Sept. 11, 2001 was a wake-up call, not just to Americans but to people in all free and democratic nations. Two dozen Canadians were killed as result of the attacks on the twin towers … Canada is not safe from such attack, and we will never be safe from such attacks as long as we're a society that defends freedom and democracy."

Under six-hour grilling

The Conservatives announced the vote for a two-year extension earlier this week, and MPs spent about six hours debating whether Canada's troops should come home next February or stay in Afghanistan until early 2009.

The Bloc Québécois and New Democratic Party voted against the motion. NDP Leader Jack Layton said the mission would see Canada straying further from its traditional role as peacekeeper.

Liberal Leader Bill Graham had said he would wait to see if the Conservatives answered all his questions regarding the two-year extension before deciding which way to vote.

The Liberals allowed their members a free vote and in the end, Graham and 29 other Liberals supported the motion.

But Graham did criticize the government for holding a vote without providing sufficient time to debate the issue.Graham said his party supports the troops and the mission in Afghanistan, but that MPs would be voting "with a gun put to our heads."

Canada has about 2,200 soldiers stationed in Afghanistan, part of the U.S.-led Operation Enduring Freedom.

Previously, Canada was a participant in the NATO-led International Stabilization Assistance Force (ISAF), and it has been reported that Canada could take over leadership of the larger NATO mission in Afghanistan in 2008.