A British black-cab driver who was sentenced to 38 years for a murder during the Iraq war should never have been prosecuted, according to the lawyer who helped overturn some of Britain’s most notorious miscarriages of justice.

The trial of Anis Sardar at Woolwich crown court in May is an example of how British justice is prejudiced against Muslim defendants – in the same way it was in the 1970s against Irish Catholics, dozens of whom ended up wrongfully convicted, said human rights lawyer Gareth Peirce, who represented the Guildford Four and the Birmingham Six.

A jury found Sardar, 38, guilty of the murder of US serviceman Sgt Randy Johnson, who died in Baghdad in 2007 after his vehicle went off-road and hit an improvised explosive device (IED). There was no evidence to connect Sardar to the bomb that killed Johnson, a father of two who lived in Germany, but his fingerprints were on a different type of device that was found in the same suburb of Iraq’s capital city.

Sardar’s account was that he had indeed picked up a homemade bomb when he went to the country with an Iraqi friend, and wrapped tape around it. He said neither he nor the bomb-makers were targeting Americans. At that time, Iraq was engulfed in a sectarian war between Sunni and Shia and the bomb-making Sardar witnessed was by a group of Sunni citizens planning to put them in the path of marauding Shia militias who had been coming into their neighbourhood to abduct and kill civilians. In court, the US army accepted both that its vehicle had been in an area soldiers had not been in for six months, and that it was on a dirt area, not the hard road surface where armoured vehicles travelled, when it hit the IED, making it unlikely Americans were the target.

Peirce said that “extremely powerful potential witnesses”, who would have helped the jury understand the Iraqi conflict, were not allowed anonymity, leaving them afraid to give evidence for fear of reprisals on families still in Iraq.

Sardar is in Belmarsh prison. His wife and two-year-old daughter are in a small terraced house in Wembley, north London, where the living room is his library, wall-to-floor shelves of books of Islamic learning and history, their titles picked out in golden ornate Arabic letters. “He loves his books,” said his wife Sadia with a smile. “He knows a lot about marriage laws, and as far as war is concerned, he believes it is a last resort and innocent people should never be involved.”

His father was a civil servant who had left India for England as a child, so when Sardar decided he wanted to study Arabic he went abroad, to Damascus, in 1997. His eventual mastering of the language was a love-hate struggle of his younger years, but he completed the final year of his degree in England and returned to the UK for good in 2007, marrying, becoming a London cabby and well known in his community for his deep knowledge of Islam, which made him a popular unpaid adviser. “He’s a learned man, an intellect, he wanted to better himself – they are not the characteristics of a terrorist,” said his wife, who believes that the horrors he saw in Iraq traumatised him and made him a quieter, more thoughtful man.

His family are launching a legal appeal and a campaign to clear his name. “We’ve all been so shocked at the conviction, we couldn’t understand how it could happen. Everyone who knows Anis is shocked. I know this is not who he is, he’s a good guy,” said Sadia, adding that their daughter will be 40 by his release.

Peirce said the case should never have been brought to court, and especially to a British court. “We are in a similar place to the IRA trials. If you look at them, it was English juries, English prosecutors and English police proceeding with complete ignorance of culture or religion. If you look at the Birmingham Six, they were seized when they were going to a funeral of an IRA sympathiser, and there was incomprehension that you could have a friend but not be in the IRA yourself, that you might have no money, that you could be Catholic and not be in the IRA, that incomprehension of how a different community worked,” she said.

“Now juries have to be educated about Islam. Anis was in Damascus because that’s where you went to study pure Arabic then. He saw the refugees coming in from Iraq and he went with a friend to try to get his family out. He talks about the situation there, how he saw the dead bodies lying in the street, in the canal, he described people coming out to the morgue at night looking for family members. Those IEDs were found in the exact spot where Shia militia came sweeping into the Sunni villages. He said, ‘I was present.’ It was an honest defence, but without context how could a jury in Woolwich grasp it? This all took place during one of the most disturbing periods of world history, in effect the aftermath of years of illegality and ambiguity where even the Iraqi army itself was a militia under another name.

“This trial proceeded amid complete ignorance, and it was utterly wrong to prosecute and wrong to convict him.”