One of Belgium’s top courts has ruled that a man who decapitated his wife and baby daughter should be freed because local officials forgot to fill in the right paperwork.

The Court of Cassation, the main court of appeal, ruled that prosecutors failed to follow the correct procedures when they filled in the forms for the trial of Abdullah Saad, 34.

The Syrian killed his wife, Noura Horyia, 23, and 13-month-old daughter Samira at their home in Wavre, 20 miles south-west of Brussels, in December 2013.

Saad has admitted the killings, which he said were committed because he thought his wife was having an affair, and that he was not the baby’s biological father. The victims’ throats were slit with a kitchen knife.

With even Saad’s lawyers saying they did not plan to contest a life sentence, it appeared an open-and-shut case. However, prosecutors in nearby Nivelles left a routine part of their application for trial on 11 March empty – the section stating that Saad would remain in detention until the court case.

“Their paperwork forgot to mention that detention was needed,” Hamid El Abouti, one of Saad’s lawyers, told The Independent. “We saw this was empty. We think someone simply cut and pasted information from another decision that was less serious. But whatever the reason, we went to the Court of Cassation to ask for our client to be released. And the court agreed.”

Damien Vandermeersch, the Court of Cassation’s Advocate General, said that from a procedural point of view, Saad had to be released. “We decided that there was no legal base to continue detaining him,” he said.

After the court’s ruling on Wednesday night, Saad’s lawyers demanded the immediate release of their client. “If they fail to comply with the court’s decision, we will demand €10,000 [£7,400] in compensation for every day our client is illegally detained,” Mr El Abouti said, adding that Saad should technically have been released on 11 March, the date on the prosecutor’s application.

The crown prosecutor in Nivelles, Jean-Claude Elslander, insists Saad will remain in custody until an appeals court makes a new ruling. “We do not have the same reading of the situation as his lawyers,” Mr Elslander said. However, the application to correct the procedure may have to wait until the next hearing, which is set for 26 May.

But Mr El Abouti says the prosecutors would be acting illegally if they continue to detain Saad. “There would be political consequences if they ignore the Court of Cassation’s ruling,” he said. “If the highest court in the land renders a decision that is not respected, that means anarchy.”