The Royal Canadian Mounted Police have arrested two suspects in connection with alleged online threats made against Prime Minister Justin Trudeau during the federal election campaign, a spokesperson has confirmed.

The RCMP executed a search warrant and arrested the two suspects in Quebec Friday, the spokesperson said. Electronic devices were seized.

The individuals' identities have not yet been made public as the investigation continues.

RCMP Cpl. Melanie Cappiello-Stebenne told CBC News that the RCMP monitors the web for threatening statements and that the force investigates whenever they believe a statement could "lead to violence."

Both suspects have been released and charges may be laid once the investigation is complete.

"We're going to be analyzing what was found in the search," said Cappiello-Stebenne.

In a statement to CBC News, the Prime Minister's Office said it would not comment on the prime minister's security.

In October, a Trudeau campaign event was delayed due to a security threat, Liberal sources told CBC News at the time.

When he eventually appeared at the event in Mississauga, Ont., Trudeau could be seen wearing a bulletproof vest under his shirt and was accompanied by a heavy security detail.