A federal judge on Friday found Chelsea Manning in contempt of court for refusing to answer questions before a grand jury.

The 31-year-old Manning was taken into custody after she refused to answer the grand jury's questions related to WikiLeaks, ABC News reported. U.S. District Judge Claude Hilton ordered Manning to be held in jail until she decides to cooperate or until the grand jury concludes its work.

Manning's lawyer said that she could be in jail for up to 18 months.

“A judge will consider the legal grounds for my refusal to answer questions in front of a grand jury,” Manning said in a statement released before her appearance. “The court may find me in contempt, and order me to jail.”

The former Army private came out transgender on the day she was sentenced to serve 35 years in prison for disclosing classified materials to WikiLeaks. Before leaving the White House, President Barack Obama commuted all but four months of Manning's remaining prison term. She served nearly 7 years of her 35-year sentence.

Last year, Manning campaigned as a Democrat to replace incumbent Maryland Senator Ben Cardin, who won reelection to a third term, taking 65 percent of the vote.