A federal judge appointed by former President Barack Obama ruled Friday that an 11-year-old girl who suffers from leukemia can use medical marijuana at her suburban Chicago elementary school.

Even though it is against the law in Illinois for students to use medical marijuana in school or for school nurses to dispense it, the judge made an exception for Ashley Surin after her parents filed a lawsuit against the school district, NBC Chicago reported.

Ashley’s parents argued that their daughter, who was diagnosed with leukemia in 2008, needs the drug because the side effects of chemotherapy and other treatments cause her to have seizures.

When Ashley began using a medical marijuana foot patch, the number and severity of her seizures declined.

“Her brain used to be like in a cloud, and now she can think clearer, and she’s more alert,” Maureen Surin, the girl’s mother, told WGN.

Although Ashley’s leukemia is in remission, her doctors allow the use of medical marijuana to treat her seizures.

The family requested that school officials have some of the medical marijuana on hand at Hanover Highlands Elementary School in case Ashley needed it, but the school district turned down their request.

The district stated that they denied the Surin family’s request because they would be in violation of a state law that bans medical marijuana on school property and school buses.

Lawyers on behalf of Ashley’s parents filed a lawsuit in the U.S. District Court for the Northern District of Illinois against the school district and the state of Illinois Wednesday.

The lawyers for the Surins argued that the state’s ban of the drug on school grounds is unconstitutional because it denies Ashley’s right to due process, violates the Individuals With Disabilities Education Act (IDEA), and violates the Americans with Disabilities Act (ADA).

Two days after the parents sued the school district, the Illinois attorney general’s office told U.S. District Judge John Blakey that it would allow the school district to administer the drug to the 11-year-old.

The state attorney general also agreed not to prosecute the parents or the child when Judge Blakey, who was appointed by former President Barack Obama, ruled in favor of the parents.

While the court case unfolded, Ashley had been out of school for two weeks. The school district said after the ruling that Ashley could return to school and staff can administer the drug without facing legal consequences.