A judge in the US state of Michigan has ruled that a schoolgirl detained after neglecting her homework and fighting with her mother cannot be released.
The black 15-year-old, identified by her middle name "Grace", has been in juvenile detention since May.
"I miss my mom," Grace reportedly told the court on Monday. "I can control myself. I can be obedient."
But the judge said detention was in her best interests for now. The case has sparked protests and claims of racism.
Judge Mary Ellen Brennan said the teenager had been benefiting from a residential treatment programme and was not yet ready to return to her mother.
"There is not a question in my mind, if I were to grant the request to release you home today, I would be making a mistake, and I would be doing you a disservice," she told Grace, according to Michigan Radio.
Judge Brennan also said police had responded to multiple incidents between the mother and daughter, and that her detainment was a result of that.
"She was not detained because she didn't turn her homework in... She was detained because she was a threat to her mother," the judge said.
She also addressed the public scrutiny the case has come under, saying she "would not be swayed by public clamour or fear of criticism".
The case was first highlighted last week in a report by US news site ProPublica. Following interviews with Grace's mother, the outlet described how the teenager had attention deficit hyperactivity disorder (ADHD) and had already been struggling with behavioural issues.
She was placed on probation in mid-April via a Zoom juvenile court hearing after facing an assault and theft charge last year; one of the terms of the probation was a requirement to do her schoolwork.
ProPublica reported that the start of Grace's probation coincided with the first days of remote schoolwork, and she quickly became overwhelmed without the in-person support of her teachers.
At a mid-May hearing at the Oakland County Family Court Division to decide whether Grace had violated her probation, Judge Brennan found the girl "guilty on failure to submit to any schoolwork and getting up for school" and called Grace a "threat to the community" because of the previous charges against her, it said.
Hundreds of students joined a rally outside Grace's school last week, calling for her release. "Black Lives Matter" signs were held up alongside "Free Grace" signs.
"I know if Grace was a 15-year-old white girl she would not be sitting in juvenile detention right now," a mother, Sheri Crawley, told local TV news station WDIV.
Thousands of people also signed online petitions calling for her release.
Another hearing has been scheduled for September, according to local media reports.