A Palestinian woman was sentenced to six months in prison on Monday for having an illegal pregnancy, an Israeli court said, in a case that has sparked international outrage.

Yusra Khudair, 28, had a miscarriage last year but was released after the Supreme Court ordered her to undergo a medical examination.

The court said Khudar had been “under a medical evaluation for illegal pregnancies”, which it described as “the most serious charge that could be levied against her”.

The court added that the prosecution had already sought Khudal’s imprisonment for up to six years and would seek to extend it to another three years if she was not released within six months.

Khudar, who was arrested in the West Bank city of Ramallah last November, had been pregnant for about six months, and her lawyer, Yehuda Gantz, told Reuters news agency that she would be released within a few weeks.

“We’re optimistic,” he said.

“There’s no reason for us to wait another six months.”

In December, the Supreme Administrative Court had ruled that Khudars pregnancy was not illegal under Israeli law, but it did not provide for a hearing to determine whether it should be classified as such.

The High Court later ruled that the abortion should be treated as a crime, with Khudaria, a lawyer for the family of a Palestinian woman who was killed in the same attack, among those being sentenced to prison.

Khadir’s lawyer said the court would not rule on the case until a hearing on Khudarian’s appeal in the Supreme Rabbinical Court, and Khudari’s lawyers said the case was on hold pending the outcome of the appeal.

“She is innocent,” said Gantz.

“We don’t want to see her executed.”

The court’s decision came after Khudarr had undergone a medical assessment in 2015, according to the Haaretz newspaper.

The decision was not immediately clear on whether the court’s ruling was binding, although the case had been pending for some time.

Khudiars pregnancy comes just months after the Israeli military said it had detained a Palestinian teenager who carried out a stabbing attack on an Israeli bus.

The 17-year-old Palestinian was shot dead after stabbing a bus driver in the Israeli town of Afula.

Israel said he had carried out the attack after being refused entry to the Westbank city of Hebron.

The teenager’s father, Yasser al-Khatib, said his son had been detained in the occupied West Bank for a few days, but he would be free after a hearing.

He also said that Khadir was not under arrest and would be freed after a few hours.

Al-Khalil, the Palestinian teenager’s uncle, said Khadar was not a terrorist, and that his nephew had been subjected to brutal and unfair attacks by Israel for a long time.

“He’s a very young child who loves his mother and she’s a mother to him.

He’s been tortured,” he told the AFP news agency.”

They are trying to make him become a terrorist.

We hope he can grow up to be a normal, healthy person.”