CHARLOTTETOWN -- A 20-year-old university student in P.E.I. agreed Friday to sign a 12-month peace bond in provincial court after an RCMP officer told a judge in March he feared Amir Raisolsadat would commit a terrorism offence that involved the use of a small rocket with a warhead carrying a chemical or biological agent.

But Raisolsadat's lawyer, Brandon Forbes, said outside court that even though his client had agreed to the peace bond, the facts of the case left him with reservations about the RCMP's allegations.

Information sworn in provincial court alleges the bespectacled student had enough castor beans to produce a "substantial quantity" of the deadly toxin ricin.

"Last I checked, it's not illegal in this country to own beans," Forbes said outside the court.

"There was a calculation that because he had beans he could produce some sort of deadly biotoxin. It's the same error of argument to say that because I have poppies growing in my backyard I must be producing opium. It doesn't take a law degree to see the problem in that logic."

Still, Forbes said Raisolsadat signed the peace bond because he wanted to put the case behind him.

Forbes said his client could either "take on the combined efforts of the state in a prolonged hearing at great expense ... or simply continue to do something that he has been doing all along; that's to live peacefully in Prince Edward Island."

Under the peace bond, the young man must remain on the Island, immediately report to a probation officer, refrain from possessing castor beans or ricin, refrain from possessing weapons, explosives or ammunition, and report to the RCMP once a week.

Raisolsadat was in court for the hearing, sitting at the edge of his seat in a dark business suit, his back straight and his hands clasped in front of him. He didn't speak inside or outside court.

He released a statement thanking his family, friends, neighbours and professors at the University of Prince Edward Island for their support.

"People should know that my family has suffered because of the incredibly public and sensational nature of the proceeding initiated against me," the statement says. "Rest assured that I would never harm anyone."

Raisolsadat was arrested in March after the Mounties applied for a peace bond under Section 810.01 of the Criminal Code, saying investigators had "fears on reasonable grounds" that he "will commit a terrorism offence."

Legal experts say peace bonds are used in terrorism-related cases when police believe they have reasonable grounds to suspect a person might engage in terrorism, but they don't have enough evidence to bring before a court for a successful conviction.

Raisolsadat was never charged with anything, and the allegations against him were not tested in court.

A search warrant application filed with the court says the RCMP received two complaints in the summer of 2013 alleging national security threats towards western countries.

Court records also allege that in early 2014, the RCMP found documents in Raisolsadat's household garbage that describe how to make the explosive compound calcium phosphide and a diagram of a small rocket with a section labelled "warhead."

"The warhead section appeared to be designed to deliver a chemical or biological agent," an RCMP officer wrote in an application for the search warrant.

Forbes dismissed the significance of the diagram, saying his assistant was able to buy the item at a toy shop.

"Its a foot-high piece of cardboard with glue and balsa wood. It's meant to put a little GI Joe up in the air and it parachutes down," he said.

Police allege it was purchased by Raisolsadat using a fake name, he said.

"We found out after the fact that it wasn't even him. It was somebody else," Forbes explained. "It's just another representation of some questions we had about the veracity of the allegations."

The court documents also allege that the RCMP conducted a covert search of Raisolsadat's home in Stratford, P.E.I., where they found between 50 and 60 castor beans.

"Based on the information contained in this document, I believe that Amir Raisolsadat has the capability and intent to carry out a terrorist activity," an RCMP officer wrote in the search warrant application. "I also believe that the results of the General Warrant show that Amir Raisolsadat has in his possession enough castor beans to produce a substantial quantity of ricin."

The Public Prosecution Service of Canada says the federal government has used peace bonds in terrorism-related matters fewer than 10 times since the law was amended in 2001 under the Anti-Terrorism Act.