A Michigan woman will spend seven days in jail after she defied a judge’s order to have her 9-year-old son vaccinated.

Rebecca Bredow was sentenced for contempt of court Wednesday, nearly a year after an Oakland County judge ordered her to have her son vaccinated. Bredow had been given until Wednesday to get her son the medically allowed amount of vaccination, which would be up to eight vaccines. But the Detroit area mother, citing her religious beliefs, had refused to do so.

“I’m a passionate mother who cares deeply about my children, their health and their well-being … If my child was forced to be vaccinated, I couldn’t bring myself to do it,” Bredow said during a court hearing, according to the Associated Press.

The jail sentence is the latest in an ongoing custody battle with her ex-husband, James Horne, who wants their son vaccinated and shares joint custody of the child.

“I understand you love your children. But what I don’t think you understand is that your son has two parents, and dad gets a say,” Judge Karen McDonald told Bredow, the AP reported.

McDonald granted Horne temporary custody of their son and ordered him to be vaccinated. She also said in court that Bredow’s attorney had signed the November court order for vaccination, meaning Bredow had agreed to it.

“It’s clear to me that you don’t care about orders even if you agree to them, which you did,” the judge told Bredow, who’s the primary caregiver of her son with Horne.

Bredow had told The Washington Post that she expected to go to jail.

“I can’t give in against my own religious belief,” she said Saturday, adding that she is not against vaccination. “This is about choice. This is about having my choices as a mother to be able to make medical choices for my child.”

Parents who either delay or refuse vaccinations for their children do so for a number of reasons, including religious, personal and philosophical beliefs, safety concerns, and a desire for more information from health-care providers, according to 2016 research published in the Journal of Pediatric Pharmacology and Therapeutics.

The American Medical Association has long decried allowing parents to decline vaccination for nonmedical reasons and has cited vaccines’ ability to prevent diseases such as measles, mumps and other infectious diseases. Still, a majority of states allow religious exemptions for vaccinations. Nearly 20, including Michigan, provide exemption for religious and personal reasons. Only three, California, Mississippi and West Virginia, don’t allow nonmedical exemptions.

In Michigan, parents or guardians of children enrolled in public and private schools are required to attend an educational session, in which they learn about diseases that vaccines can prevent, before they’re given waivers for nonmedical purposes.

Bredow said that’s what she had done. She added that she and Horne had initially agreed to delay their son’s vaccines for three months after he was born in 2008. Two years later, in 2010, she said they both agreed to suspend all immunizations, and their son has not had a vaccine shot since.

Horne’s attorney, Benton Richardson, was not available for comment Wednesday, but he told ABC last week that the legal dispute was not about vaccinations.

“It is a case about Ms. Bredow refusing to comport with any number of the court’s orders and actively seeking to frustrate Mr. Horne’s joint legal custody rights,” Richardson said.

The legal dispute also comes amid a growing anti-vaccine sentiment, which began in 1998, when a medical journal published a now-discredited study linking vaccination with autism. The once-fringe movement has become more popular and received a nod of approval from Donald Trump, who repeatedly suggested a link between vaccination and autism before he ran for president.

In January, vaccine skeptic Robert F. Kennedy Jr. said the then-president-elect had asked him to chair a new commission on vaccines. A spokeswoman later said that Trump was exploring the possibility of creating a commission on autism. The plan appears to have stalled. Kennedy told STAT News last month that he has had no discussions with White House officials about the commission since February.

Several people who support Bredow gathered outside the Oakland County courthouse Wednesday, holding signs saying they “Stand with Rebecca” and “No Forced Shots.”