Canada's government has introduced an anti-terror law that expands the powers and reach of the country's spy agency, allowing it to operate overseas for the first time.

The act was written in response to the first terror attacks on Canadian soil last October, when a gunman killed a ceremonial guard and stormed parliament, and a soldier was run over in rural Quebec.

A large number of critics have decried bill C-51 as an unprecedented assault on civil rights, saying it lacks oversight and is overly broad.

It criminalises the promotion of terrorism, makes it easier for police to arrest and detain individuals without charge.

The legislation expands the Canadian Security Intelligence Service's (CSIS) mandate from intelligence-collection to actively thwarting terror plots and spying outside Canada.

Ottawa said the new measures were also needed to stem a tide of young Canadian men and women travelling abroad to join the Islamic State extremist group.

At least six Canadians have died over the last two years fighting alongside extremists in Syria and Iraq.

Prime minister Stephen Harper's Tory majority in the House of Commons assured its passage, in a 183 to 96 vote, after several failed opposition attempts to water it down.

The government held the measure up as necessary to better uncover and rout terrorist plots.

"We need to make sure that the jihadi international terrorists who are threatening us are prevented from acting by filling the gap of our information sharing," public safety minister Stephen Blaney said in parliament.

The act marks the biggest overhaul of Canada's anti-terrorism legislation since 2001, when Ottawa rushed through new national security measures following attacks in the United States.

It will now likely be granted royal ascent in June.

Critics decry 'excessive' new powers

Four former prime ministers and top judges have led criticism of the new law, joined by aboriginal chiefs and environmentalists who fear being targeted by police in the crackdown.

As part of its new mandate, CSIS could intercept financial transactions, prevent a suspect from boarding a plane, intercept weapons or conduct "online counter-messaging," for example, by hacking a Twitter account used to recruit jihadists.

But the opposition New Democratic Party said the law was "vague, dangerous and won't make Canadians safer".

"Thousands of Canadians took to the streets to protest this bill which will erode our rights and freedoms," NDP MP Randall Garrison said.

"These people don't want fear to triumph over the values that guide our democracy."

Privacy commissioner Daniel Therrien also declared the scope of the new powers "excessive" and the safeguards it lays out against privacy breaches "seriously deficient".

"All Canadians would be caught in this web," he warned.

Internet activist group OpenMedia vowed to make the bill an election issue, saying: "Passing this reckless legislation will be an albatross around [the Tories'] neck moving into the election."