A Nigerian court on Tuesday formally struck out a case against a 15-year-old girl accused of killing her 35-year-old husband with rat poison.
But Wasila Tasi'u, who was 14 at the time of the alleged murder, was forced to spend another night in custody because of delays in filing paperwork for her release.
The teenager was charged with culpable homicide and faced a possible death sentence if convicted of deliberately lacing a meal she cooked for her husband Umar Sani with rat poison.
Sani and four others died within hours in April last year.
Activists, who celebrated as she was acquitted, had used the case to highlight the issue of child marriage, which is common in mainly Muslim northern Nigeria.
They argued she should be treated as a victim but Wasila's family maintain she was not forced into marriage and that 14 was a standard marrying age in the region.
Her defence lawyer Hussaina Aliyu on March 16 called for the case to be dismissed on the grounds the prosecution had failed to establish her intent to kill Sani and exactly how he died.
The prosecution applied for murder charges to be withdrawn on May 20. The case was adjourned pending the agreement to her release from the attorney general of the northern state of Kano.
Judge Mohammed Yahaya, sitting at the High Court in Gezawa, near the state capital, Kano city, confirmed receipt of notification that the state was willing to drop the case.
"I have no alternative than to pronounce according to law that the application of 'nolle prosequi' (unwilling to pursue) is hereby granted," he told the court.
"In consequence, therefore, you, Wasila Tasi'u, are hereby discharged."
Wasila, who was in court wearing the full-face veil or niqab, gazed at the floor during the hearing, said nothing after the ruling and was taken back to a juvenile detention facility.