Selina Garcia, a 17-year-old senior from Southeast Raleigh High School in Wake County, N.C., has just been released after spending three weeks in prison for getting into a school brawl.

Garcia pled guilty to misdemeanor counts of disorderly conduct at her court hearing this Thursday. The Afro-Latina teen was arrested on March 7 by a school resource officer after she allegedly punched another student in the head on a school bus. She was then placed in the Wake County Detention Center until March 10, when the judge ordered her release until this past week's hearing.

Still, Garcia remained locked behind bars.

North Carolina law states that any 16- or 17-year-old charged with a crime, including misdemeanors, will be put into the adult legal system. However, Garcia is still considered a minor by the state's social service laws, and as such, she could only be released into the custody of her legal guardian.

But Selina Garcia happens to be a foster child -- she has no legal guardian. When no one came to pick the girl up, the state had no choice but to have her remain in jail until the hearing.

For weeks, many protested Garcia's confinement, a reflection of the state's inability to properly care for foster children, and the school system's over-reliance on using law enforcement to punish student behavior. The Legal Aid of North Carolina filed a complaint with the U.S. Department of Justice against the Wake County School System in January. According to the complainant, district use of "school resource officers" has resulted in a disproportionate number of minority students being turned over to the county legal system.

Jennifer Story, an attorney with Legal Aid of North Carolina's Advocates for Children's Services, has been one of the most vocal advocates for Garcia's release. She has followed Garcia throughout her journey through the foster-care system. Garcia had suffered major abuse as a child before she entered foster-care and has jumped from various homes and schools in the last two years.

"You cannot use jail as a boarding house for foster children," said Story.

Upon her release on Thursday, Wake County officials confirmed that they were able to find placement for Garcia in Raleigh. Garcia told the judge she will work on managing her anger and setting a better example. Story said that they will work with the school system to make sure Garcia graduates this year.