MISSOULA, Mont. (AP) — A federal judge ordered a Montana newlywed released from jail Thursday as she awaits trial on charges that she pushed her husband to his death over a cliff in Glacier National Park because she was having second thoughts about marriage.

Prosecutors immediately sought to reverse Thursday’s order from U.S. Magistrate Judge Jeremiah Lynch, saying 22-year-old Jordan Linn Graham of Kalispell was a risk to the community and had lied to investigators.

But Lynch said the government had not shown that Graham was a danger to the community nor a flight risk — the two main factors in deciding whether someone should be released. He ordered her into home detention at her parents’ house in Kalispell, and to undergo a mental health evaluation.

The fact that Graham allegedly admitted to her actions in July yet authorities did not file charges until this week suggests she was not as dangerous as prosecutors have described, Lynch said.

“The government does not point to any evidence that Graham somehow represents more of a danger now than she did in July, at which time the government opted to continue its investigation without arresting or charging her,” Lynch wrote in his order.

Prosecutors said they would file an additional motion Friday detailing why the release order should be revoked. It was uncertain when the court would act on the request.

Graham was freed after being told the conditions of her release during a Thursday afternoon hearing.

She is accused of shoving Cody Lee Johnson, 25, off a steep cliff near a popular trail in the park on the night of July 7 during an argument. An FBI agent said in a statement accompanying the charging documents that Graham had told a friend she was having second thoughts about her 8-day-old marriage and planned to confront Johnson with her concerns.

Tracey Maness, a longtime friend of Cody Johnson’s mother, Sherry, said family and friends were disappointed by the judge’s decision to release Graham. Maness declined to comment further, telling The Associated Press in an email Thursday that the family has asked friends to stop talking to the media.

Lynch’s ruling followed a Wednesday hearing in which Graham’s public defenders argued for her release pending trial. She would stay with her parents in Kalispell and did not pose a flight risk, attorneys Andrew Nelson and Michael Donahoe argued.

But Assistant U.S. Attorney Zeno Baucus argued against Graham’s release, saying she repeatedly lied to law-enforcement officers and poses a safety risk to herself. Graham had previously sent text messages to a friend saying she wanted to die and hated her life, KECI-TV reported.

Prosecutors say Graham confessed to pushing Johnson from the cliff near the Loop Trail several days after she initially told investigators he drove away with a friend from out of town.

She told a park ranger three days after Johnson was reported missing that she had found Johnson’s body, saying she looked in that area because it was “a place he wanted to see before he died,” according to the FBI affidavit.