"My hands were tied. The doctor drew a circle on my back around my heart. I was to lie on the sand for the executioner to shoot me. Then I heard the phone call.” Hafedh Ibrahim’s words trip mechanically off his tongue as he describes being moments from the carrying out of his death sentence. I feel guilty making him relive it for my television camera. Especially because, being television, I make him relive it again “just one more time, please Hafedh, show me where the pile of sand was”.

The memory is clearly painful, more so for all the friends who never got a clemency call from the President’s office. During seven years on death row, Hafedh waited up with prisoners on their last night, sharing their last meal, talking about their lives, refusing to sleep as long as he could so that when the condemned men were led out to the executioner in the morning he’d collapse in tiredness and sleep through the sound of shots.

Hafedh was just 16 when he was put on death row. He says the killing he was blamed for was an accident. Like virtually every boy in rural Yemen, Hafedh was given a gun as a teenager. Carrying it one day, he was mugged, and in the struggle, the gun went off, killing an innocent bystander. “I had no intention of killing him. But the weapon was in my hands. I thought about his family every day and always felt if they wanted to take my life then I could understand that.”

Download the new Independent Premium app Sharing the full story, not just the headlines

In court, Yemen’s Islamic judges treated Hafedh as an adult, as they traditionally did with anyone over 15, and sentenced him to death. That sentence is illegal for juveniles in Yemen but the Sharia courts are famous for sometimes preferring their own standards. “The main problem”, says Hafedh, “is that they don’t recognise official documents. They don’t accept the killer is a child. The judges try to break law to get the execution verdict.”

In Hafedh’s case, the mercy call came only because his campaigning was noticed by Amnesty International, who took up the case with the former President, Ali Abdullah Saleh, who was trying to shore up his regime from the threat of al-Qa’ida with Western allies like the US and Britain. That was six years ago. Yet today, post Arab Spring uprising, with Yemen in the middle of a National Dialogue on a democratic future, its prisons are still full of people awaiting execution for crimes committed as children. Two have been shot dead this year despite international human rights campaign.

Hafedh worked hard for his school exams in prison. On being released there was only one place he wanted to go: law school, to fight for those he’d left behind. On getting there he found one of the judges who sentenced him to death was one of the professors. He qualified and went straight to the case of his best friend in prison, Mohammed Hazaa, who was executed in March this year, despite arguing that the murder for which he was convicted took place when he was a juvenile.

In their last conversation, Mohammed told Hafedh of a boy whose case was urgent.

AbduRahman Al Alimi was only 16 when he was arrested after his brother-in-law was killed during a family feud. Mohammed believed the boy’s story that he’d been wrongly blamed and knew he could end up on death row. He made Hafedh promise to save the boy.

That is why Hafedh has come back to his old prison – again. “Mohammed died but AbduRahman will survive”, he says, with a steely determination.

It will not be much easier than saving Mohammed. Vast numbers of Yemenis in poor rural areas don’t know their birthdays and their parents didn’t get birth certificates. Documents are often forged and rarely trusted.

The Yemeni prosecutors get doctors to X-ray suspects and estimate age from the density of the bones. It is regarded as having a margin of error of between a few months and a couple of years. AbduRahman’s test left the doctor saying he was three years older than he claims: old enough to be executed.

Daily coronavirus briefing No hype, just the advice and analysis you need Enter your email address Continue Continue Please enter an email address Email address is invalid Fill out this field Email address is invalid Email already exists. Log in to update your newsletter preferences Register with your social account or click here to log in I would like to receive morning headlines Monday - Friday plus breaking news alerts by email Update newsletter preferences

That is despite school records and identity papers saying otherwise. Amid the brutalities of the system there are contradictions too. When Hafedh entered the prison to meet AbduRahman he was welcomed as a returning hero. Inmates crowded around, kissing him enthusiastically, shouting out and telling him of cases he should fight. But the prison soldiers seemed just as pleased to see him. The man who would have witnessed his execution gave him a warm embrace and said: “He’s a good man. A very good man.”

Later that week, I followed Hafedh to court as he went to argue AbduRahman’s case . This was to be the day the boys age was settled. A victory would mean he’d be transferred to the juvenile system and there’d be no question of the death penalty. Yemen’s courts are open to the media and we were given permission to film. But once they realised what case and issue we were following, the court was adjourned and everyone sent home.

Speaking alone, the judge asked Hafedh to split whatever money he was being paid for the case. “I’ve always known under the table deals go on but I’ve never been asked so directly for a bribe,” said the young lawyer, anxious that AbduRahman’s case might now depend on corruption.

What is clear is that the post-Arab Spring government does not respond well to outside pressure. In March, Human Rights Watch and other organisations tried to highlight the issue with a campaign.

Within days, Mohammed Hazaa had been executed. And those organisations have still to be given the kind of access given to Channel 4. In two weeks we met dozens of prisoners who claimed their crimes were carried out while they were juveniles. We met several teenagers who said their cases were going back to court as victims’ families tried to argue they were adults eligible for the death penalty.

The fact a television documentary team was allowed into Yemen’s prisons, and given access to controversial cases, suggests the people in charge want change too. Right now, it is left to people like Hafedh to take all those cases on. He does it voluntarily, in the spare time from his government job.

“Having escaped jail are you now trapped by a need to fight these cases?”, I wondered. “Yes”, he replies “now I have a wife and baby I try to get on with my own life too. But I often wake up suddenly in the night thinking of people like AbduRahman in prison, worrying what I must do to stop him being killed.”

‘Unreported World: Death Row Teenagers’ is being broadcast Friday at 7.30pm on Channel 4