BRUSSELS — An appeals court in Belgium ruled Wednesday that the Belgian government is not obligated to repatriate from Syria two Belgian women who joined the Islamic State or their six children.

The ruling was a victory for Belgium’s leaders, who had said they should not have to expend state resources to bring back Bouchra Abouallal, 25, and Tatiana Wielandt, 26, two women from the Antwerp area who traveled twice to Syria with their children to live in theIslamic State’s self-proclaimed “caliphate.”

It was a defeat for the women and their children, who range in age from 8 months to 7 years. A lower-court judge ruled in December that the government needed to bring back the children — and that because it would be a violation of the children’s rights to be separated from their mothers, the mothers needed to be brought back, as well.

Justice Minister Koen Geens said in a statement Wednesday that the government will continue to try “to return children of [foreign terrorist fighters] younger than 10 years. Children can never be blamed for the actions of their parents.” The government has been engaged in a complicated diplomatic dance to try to bring home Belgian children from Syrian camps.

The appeals court threw out the lawsuit on a technicality, saying it was too similar to a previous lawsuit against the state that failed.

Wednesday’s decision opened the door to Belgian authorities’ bringing back the children without their mothers, something Abouallal and Wielandt have said they would accept. The women, who are sisters-in-law, are living in the Ain Issa camp in a Kurdish-controlled area of northern Syria, in conditions that they say are dangerous. They have disavowed their allegiance to the Islamic State.

Abouallal’s mother, Fatiha, spoke to The Washington Post this month about her efforts to bring her family home, which included preparing beds for all six children in anticipation of their return.

Belgian doctors and psychologists who examined the children in a different camp last fall said one of them is suffering from medical problems that could prove lethal. A split from their mothers would be psychologically devastating, said psychologist Gerrit Loots, because they have been through wartime trauma and have depended exclusively on their mothers for support.

But the idea of bringing back the mothers has been politically controversial in a country where many people are in no mood to forgive the actions of people who allied with a militant group that targeted the Brussels airport and subway in deadly attacks in 2016.