Chelsea Manning, the former U.S. Army intelligence analyst who served seven years in prison for leaking military information to WikiLeaks, was taken into custody Friday for refusing to answer questions before a grand jury investigating the whistle-blowing organization and its founder, Julian Assange.

U.S. District Judge Claude Hilton determined that Manning was in contempt of court after a short hearing Friday morning, in which Manning said that she had no plans to answer prosecutors’ questions and would “accept whatever you bring upon me,” the Associated Press reports.

Hilton ruled that Manning will stay in prison until she decides to testify, or until the grand jury has completed its investigation into WikiLeaks.

Manning’s attorney, Moira Meltzer-Cohen, told reporters outside the courthouse that Manning could be imprisoned for up to 18 months, the term of the grand jury.

Meltzer-Cohen lauded Manning’s “tremendous courage,” and slammed the government for neglecting her medical concerns. Manning, who is transgender, had asked to be sentenced to home confinement instead.

“Our primary concern at this point is her health while she’s confined,” the lawyer said. Prosecutor Tracy McCormick said U.S. Marshals have promised that Manning’s health needs will be attended to.

“The government does not want to confine Ms. Manning,” McCormick said, according to The Washington Post. “She could change her mind right now and decide to testify.”

In 2013, Manning was sentenced to 35 years in prison for leaking thousands of classified documents to WikiLeaks while working for the U.S. military in Iraq. Former President Barack Obama commuted her sentence in 2017.

Manning first revealed that she had been subpoenaed to testify in the case on Feb. 28, three months after prosecutors accidentally disclosed that a federal criminal complaint had been filed against Assange. The complaint remains under seal, so it’s not yet clear what the charges contain—but The Washington Post reports that previously, prosecutors had mulled charges including conspiracy, theft of property, and a violation of the Espionage Act.

Manning told The New York Times that she planned to resist the subpoena, and that her legal team would file a motion to quash it.

She appeared in court in the Eastern District of Virginia on Wednesday, but said in a statement emailed Thursday that she had declined to answer prosecutors’ questions.

“Yesterday, I appeared before a secret grand jury after being given immunity for my testimony,” she wrote, arguing that “All of the substantive questions pertained to my disclosures of information to the public in 2010—answers I provided in extensive testimony, during my court-martial in 2013.”

Manning said that during the Wednesday hearing, she told lawyers that their questions violated her First, Fourth, and Sixth Amendment rights, among others.

“In solidarity with many activists facing the odds, I will stand by my principles,” she added. “I will exhaust every legal remedy available. My legal team continues to challenge the secrecy of these proceedings, and I am prepared to face the consequences of my refusal.”