This photo provided by the Ramsey County Sheriff's Office shows Tnuza Jamal Hassan. Ramsey County Sheriff's Office via AP

A federal magistrate judge on Monday asked a federal prosecutor whether keeping a young woman accused of attempting to join al-Qaida in detention will help harden her "self-radicalization."

In an arraignment and detention hearing for Tnuza Hassan, a 19-year-old former St. Catherine University student, Andrew Winter, an assistant U.S. attorney, argued that Hassan should remain in detention because she is a flight risk and a danger to the community.

Hassan was accused of setting fires in several buildings at the university in January. When she allegedly carried out the arson, she was apparently hiding from her family at the school.

Hassan had been questioned by the FBI several months before the alleged arson.

In September, FBI agents interviewed her about whether she authored and delivered a letter to two fellow students at St. Catherine in March 2017. Prosecutors allege the letter sought to encourage fellow students to "join the jihad in fighting" and to join al-Qaida, the Taliban or al-Shabab.

"Why would you live under a manmade law over the law of Allah," Hassan wrote in the recruitment letter, which prosecutors say she admitted to writing after initially lying to the FBI agents about who wrote the letter or who delivered it to the students.

On two separate occasions in the last five months, Hassan's family reported her as missing to law enforcement, according to a memorandum in support of her detention filed Friday evening by federal prosecutors.

On Sept. 19, Hassan attempted to travel to Afghanistan to join al-Qaida. A day later, her family reported her missing. Hassan got as far as Dubai, "but for a lack of visa, she may well be in the ranks of (al-Qaida) at this moment," according to a court document.

On Dec. 29, Hassan again tried to leave the United States for Ethiopia with her mother. But authorities stopped Hassan from boarding and her mother chose not to travel on.

Nearly three weeks later, she was found hiding in a dorm lounge at St. Catherine after she allegedly set the fires at buildings at the university on Jan. 17.

But it wasn't until Feb. 7 that federal prosecutors charged her with attempting to provide support to al-Qaida, arson and making a false statement to the FBI.

The U.S. Attorney's Office in Minnesota declined to comment on why they are bringing federal charges now.

Winter depicted Hassan as a young woman "determined and capable" of joining al-Qaida. He said Hassan has "made great efforts to hide her tracks from the law enforcement" when she was planning her travel to Afghanistan, where she hoped she would join al-Qaida.

She left her cell phone behind and booked a flight from Minneapolis to Dubai because she did not want to alert law enforcement if she purchased a ticket to Kabul, Winter said. He added that Hassan is against ISIS but considers al-Qaida a credible movement that is "helping create the true caliphate."

Magistrate Judge Steven E. Rau agreed with Winter that Hassan is a flight risk and a danger to the community and ordered her detained in Sherburne County as the case proceeds.

"I don't feel confident enough in what your family can do," Rau said.

Rau, though, entertained the idea of releasing Hassan to her family under house arrest once he learns more about her family.

He wondered whether "we are continuing her self-radicalization" if Hassan remains in detention. "We are emphasizing it. We are encouraging it," he said.

Winter said Hassan's self-radicalization started by watching YouTube videos of well-known jihadist leaders, like Anwar al-Awlaki, a leading influence on jihadists before his 2011 death who was accused of playing a role in radicalizing Western youth with his lectures in colloquial American English.

Hassan's lawyer, Robert Sicoli, portrayed a different picture of his client. He said Hassan is a "very unsophisticated" woman who had no contact with anyone in Afghanistan. He said the fires at the university did not cause damage and were put out even before St. Paul firefighters arrived.

He accused the government of omitting crucial information in an incident involving Hassan and federal agents. Winter, the assistant U.S. attorney, wrote in the Friday memorandum that Hassan "violently resisted jailers and federal agents, repeatedly kicking one officer, and attempting to scratch both a jailer and an FBI agent," forcing her to be put in restraints.

But Sicoli said the government failed to mention that Hassan is a devout Muslim who wears the burqa, a veil that covers a woman's entire face with a slit left for the eyes. A man was not supposed to touch her unless he is married to her, he said.

When the agents attempted to remove the burqa, a scuffle ensued because Hassan refused to let agents remove her burqa.

In the court Monday, a U.S. marshal stood near Hassan's mother and sister through the nearly one-hour proceeding. Their daughter sat in the defense table, attentively listening to the proceedings. She wore a white burqa in court.

The judge asked the mother to turn over Hassan's passport to the marshals. She hurriedly took it out from a small black purse and gave it to him.

Both the mother and sister kept shaking their heads in disbelief when Winter said Hassan told agents that she will "kill innocent Americans" since American forces are "killing innocent Muslims" in Muslim countries.

A marshal told Hassan's family to stop shaking their heads.

"Just listen. That is it," the marshal told them. "It's a serious business for her."