The Connecticut supreme court ruled on Thursday that state officials are not violating the rights of a 17-year-old girl by forcing her to undergo cancer chemotherapy she does not want.

The decision came in the case of the girl known in court documents only as Cassandra C, who will be free to make her own medical decisions when she turns 18 in September. Her mother agreed with her decision against chemotherapy.

The case centred on whether the girl is mature enough to determine how to treat her Hodgkin’s lymphoma, which she was diagnosed with in September. Several other states recognise the “mature minor doctrine”.

Cassandra is currently confined in a room at Connecticut Children’s Medical Center in Hartford, where she is being forced to undergo chemotherapy. Doctors said the chemotherapy would give her an 85% chance of survival, but without it there was a near-certainty of death within two years.

The teen’s mother, Jackie Fortin of Windsor Locks, said after the arguments on Thursday that she would not allow her daughter to die. She said they just want to seek alternative treatment that does not include putting the “poison” of chemotherapy into her daughter’s body.

Fortin and her lawyer said they are considering their next step after losing the case.

After Cassandra was diagnosed with high-risk Hodgkin’s lymphoma, she and her mother missed several appointments, prompting doctors at Connecticut Children’s Medical Center to notify the state department of children and families, court documents say.

The child welfare agency investigated and a trial court granted the agency temporary custody of Cassandra. Lawyers for Cassandra and her mother then sought an injunction prohibiting medical treatment but were unsuccessful. The teen underwent two days of treatment in November but ran away for a week, court documents say.

Cassandra’s treatment resumed on 17 December, with surgery to install a port in her chest that would be used to administer the drugs. Chemotherapy began the next day and continues, court documents say.

Child welfare agency officials defended their treatment of Cassandra, saying they have a responsibility to protect the girl’s life.