Ms. Hartman’s court-appointed lawyer could not be reached for comment on Sunday.

At a hearing on Saturday, Judge Stephanie K. Miller ordered Ms. Hartman released on her own recognizance on the condition that she received psychiatric help, stayed away from O’Hare and British Airways and wore an ankle monitor until her case was concluded, The Chicago Tribune reported.

Ms. Hartman was at the Cook County Jail because she did not have a place to stay in Cook County, which was a requirement for the electronic monitoring, Sophia Ansari, the press secretary for the Cook County Sheriff’s Office, said.

Ms. Hartman has been convicted of misdemeanors for criminal trespassing at O’Hare four times in recent years, Ms. Simonton said, but this is her first felony charge.

In 2016, Parle Roe-Taylor, the assistant public defender representing Ms. Hartman in Chicago, spoke about her client’s “mental health issues,” saying that jail was not the appropriate place to deal with those problems.

“But we do see it often and until we are able to devote the resources that are necessary for treatment — and it is a very expensive process — I think that we are going to continue to see more Marilyn Hartmans,” she said.

In addition to her arrests in Illinois, Ms. Hartman has also been arrested in Arizona, California and Florida. During a 2016 hearing in Chicago, prosecutors said she had been stopped by the police on airport properties a dozen times in different parts of the country, The Chicago Sun-Times reported.