Chelsea Manning said Monday she was denied entry into Canada because of her criminal record in the United States.

The transgender woman was known as Bradley Manning when she was convicted in 2013 of leaking a trove of classified documents. She was released after serving seven years of a 35-year sentence, which was commuted by President Barack Obama in his final days in office.

On Monday, she posted a letter from Canadian immigration officials to her Twitter account that said she was not admitted because she was convicted of offenses deemed equivalent to treason in Canada. She had tried to cross at the official border office at Lacolle, Quebec, on Friday.

Manning said she would challenge the decision.

Canadian Public Safety Minister Ralph Goodale suggested Monday that he would think hard before overruling a border officer's decision.

"No such request has been made to me with respect to that matter," Goodale said. "And, when a Canada Border Services officer has exercised appropriately within their jurisdiction the judgment that they are called upon to make, I don't interfere in that process in any kind of a light or cavalier manner."

People whose criminal records make them ineligible to enter Canada aren't necessarily out of luck. They can apply for what is known as a "temporary residency permit," either before trying to enter the country or at the border. To be eligible, the person has to prove their need to enter or stay in Canada outweighs any risk they might pose to Canadian society.

Whether Manning attempted to apply for such a permit is unknown.

Immigration lawyer Peter Edelmann said either the minister of public safety or immigration could also step into allow her to enter Canada, perhaps on humanitarian grounds. "Both ministers could make an exception if they wanted," he said.

Prime Minister Justin Trudeau declined to comment on the case, saying he wanted further details.