Canadian police have charged a military official with leaking government secrets to a foreign entity, the first case in recent memory of a Canadian facing espionage charges at home.

The Royal Canadian Mounted Police said it was not aware of any threat to public safety as a result of the alleged offenses by a person they described as a Canadian Forces employee, including breach of trust and communicating safeguarded information to a foreign entity.

The investigation demonstrates that Canada is not immune to threats posed by foreign entities wishing to undermine Canadian sovereignty, RCMP Commissioner Bob Paulson said in a statement.

It was the first time anyone has been charged under a new secrecy law enacted after the September 11, 2001, attacks, according to the statement.

The RCMP declined to provide more details as the case is before the courts, but the Globe and Mail newspaper reported that the accused was a Navy sub-lieutenant and intelligence officer from Halifax, Nova Scotia, home to a major naval base on the Atlantic Coast.

He will appear in a Halifax court on Tuesday for a bail hearing, the paper said.

Espionage arrests are rare in Canada despite recent scares including cyber-attacks on two economic ministries in February 2011, and controversial comments by the country's former spy chief in 2010 that some politicians were under the influence of a foreign government.

In 2006, Ottawa said it would deport a man it accused of being a Russian spy, living in Canada under a false identity for more than 10 years.