Rohan Wray, 22, and Chana Al-Alas, 19, after being cleared of killing Jayden, their four-month-old son who was suffering from rickets. Photograph: Sean Dempsey/PA

A young couple walked free from court after being cleared of killing their four-month-old son who was suffering from rickets, a vitamin D deficiency that causes softening of the bones.

Rohan Wray, 22, and Chana al-Alas, 19, of Islington, north London fell under suspicion when baby Jayden died suddenly two years ago.

But, following a six-week trial at the Old Bailey, charges of murder and causing or allowing his death were dropped.

A jury returned not guilty verdicts on the direction of the judge after prosecutors withdrew the charges.

The couple, who were 16 and 19 when Jayden was born, hugged and kissed when they learned that their ordeal was over.

The court heard that Jayden died from brain damage and swelling, but nearly 60 medical, professional and expert witnesses were unable to agree on the cause.

Wray and al-Alas denied causing any injury to Jayden. The defence maintained that the seizures and fractures were linked to rickets.

Sally O'Neill QC, defending Wray, told jurors: "Jayden was indeed a much-loved and cared-for baby. Their care for him was transparently that of loving parents, even though they were young."

She said the couple had been "pre-judged" by doctors and police, but no one had known how ill Jayden was.

Wray told the court he was "very excited at the thought of being a parent" when he found out his girlfriend was pregnant. He said he was confused by the baby's injuries.

Al-Alas told the court the baby had a cold. She looked into his mouth and found his tongue was in the roof of his mouth.

Asked if she or Wray had shaken the baby or injured him, she said: "Never."

Her QC, Michael Turner, told the court there had never been any criticism of the couple's care for the baby.

The case comes amid legal warnings to prosecutors that shaken-baby cases should be supported by other evidence of abuse. And some experts believe that breastfeeding mothers, which al-Alas was, should be given vitamin D supplements.

Jenny Wiltshire, al-Alas's solicitor, said outside court: "Chana al-Alas and Rohan Wray can now be allowed to grieve the tragic loss of their son, who they loved and cherished.

"They have been through two and a half years of hell. They were prevented from comforting their dying son or attending his christening – all because clinicians at both hospitals failed to diagnose congenital rickets."

She added: "The real criminality in this case is that, if the money spent on this case had been directed to fulfilling the 1991 government directive that breastfeeding mothers be given vitamin D supplements, this death would not have occurred and rickets, which is now back up to epidemic proportions in this country, would have been wiped out."