A 30-year-old assault-rifle collector from Pakistan has been arrested on allegations that he is a terrorist threat to Canada. The Ontario resident is in jail, charged under immigration laws that would allow him to be deported, just one year after he avoided prison on different charges.

The new case shows how the Canadian government's approach to suspected extremists may be evolving – rapidly – since two soldiers were killed last week in attacks the government has called terrorism.

"We have to have a strategy to intervene [and] … prevent as well as detect and prosecute. That's, in a nut shell, our strategy," RCMP Commissioner Bob Paulson said on Monday, urging Parliament to make it easier for police to get search warrants and to seek restrictions on the movements of suspects in terrorism investigations.

Story continues below advertisement

He also said federal agents are reopening old cases and sharing information among agencies in hopes of stopping potential threats.

Muhammad Aqeeq Ansari, a Karachi-born software designer who has lived in Ontario for several years, was arrested on Oct. 27. His lawyer said on Wednesday in an interview he is charged under the Immigration and Refugee Protection Act with being a danger to the security of Canada.

He said federal officials allege Mr. Ansari has ties to terrorists in Pakistan, that he had amassed "a small arsenal" of guns; and that he has expressed extreme opinions on Twitter.

Under Canadian law, less evidence is required to deport someone than to send them to prison.

"This is the easiest way of squeezing somebody," said Anser Farooq, a Mississauga-based lawyer who has defended clients accused of terrorism offences.

He will represent Mr. Ansari on Friday before a tribunal at the Maplehurst Correctional Complex. "It is in the interest of society that allegations such as Mr. Anari's are addressed in a court of law with a Superior Court Judge," Mr. Farooq said.

Court records obtained by The Globe show Mr. Ansari last year surrendered 12 guns to authorities – including rifles such as a Bushmaster BACR, and several handguns.

Story continues below advertisement

This was part of a plea bargain to get a conditional discharge on Criminal Code charges of illegally storing lawfully acquired firearms. Those proceedings did not include allegations of terrorism.

Records show Mr. Ansari agreed to surrender his passport and agreed not to buy or possess any firearms for five years.

People close to Mr. Ansari described him to The Globe as a firearms enthusiast and a strict Muslim. But they doubt he is capable of violence. "I think he was just a shooting hobbyist who didn't follow the regulations," said Ed Burlew, who represented Mr. Ansari in the criminal case.

"He's not a bright guy. The RCMP is wasting time and money on him," said Naseer Syed, a Peterborough doctor who helped post bail in the firearms case.

Public Safety Minister Steven Blaney recently said that 20 federal agencies are working together on national security cases.

The immigration charges against Mr. Ansari indicate he became a person of interest in an investigation by the RCMP-led Integrated National Security Enforcement Team in Ontario.

Story continues below advertisement

RCMP and CSIS officials told a Parliamentary committee this week they are taking another look at old cases after last week's attacks.

On Oct. 20, a soldier was mowed down by a Nissan Sentra. Two days later, another was killed by man with a hunting rifle. Police suggested the suspects, both shot dead, acted in retribution for Canada's decision to deploy warplanes to bomb Islamic State militants in Iraq.

On a Twitter account that has not been updated since the day of Mr. Ansari's arrest, @aqeeqansari appeared to suggest at least one of last week's attackers was framed.

"#MartinRouleau … Seems like the cops shot the guy and placed the knife," the account says, referring to one the suspected terrorists.

The parents of Mr. Ansari told The Globe in an interview the family immigrated to Canada in the past decade. Describing their son as a software engineer who never got his citizenship, they said they had wanted to escape violence in Pakistan. "I appreciate this country because it's like heaven," said his father, Muhammad Athar Ansari.

With reports from Patrick White and Stephanie Chambers

Story continues below advertisement

Editor's note: An earlier version of this story incorrectly stated that Muhammad Aqeeq Ansari surrendered 10 guns. The actual number is 12. This version has been corrected.