Has anybody heard of William Garrow? The chances are you will have soon, as a new BBC drama based on this unsung hero of the criminal justice system began on Sunday.

Garrow was a pioneering barrister who stood up for the rights of the defendant in criminal trials in the late 1700s. He coined the term ‘innocent until proven guilty’, and was the driving force behind the concept that defendants should have legal representation.

The BBC series is based on transcripts of real Old Bailey cases from around 1780. The youthful Garrow is played by Andrew Buchan, best-known as Jem Hearne in the BBC’s Cranford series and John Mercer in ITV’s action drama The Fixer.

Garrow’s flamboyant style turned cross-examination into an art form. He often levelled insults at those he cross-examined, and he revelled in the celebrity it brought him. He also had an illicit affair with the wife of a prominent MP, who became his enemy.

Garrow was involved in around 1,000 cases at the Old Bailey, according to records. Coming from a lower-middle-class background, he was considered a common and ignorant upstart by fellow barristers.

Each episode features two criminal trials from the time. As well as revealing the unsavoury nature of justice during this era – baying mobs, petrified witnesses, judges more interested in what they’re having for lunch – it also shows the emergence of rules that are still in place today. In episode two, Garrow reluctantly agrees to act for a disagreeable character in an early example of the cab rank rule.

As a defence lawyer in the late 18th century, Garrow faces a difficult task. He is not allowed to see the indictment against his clients, to visit them in prison, or to address the jury. And there is no presumption of innocence. Sound familiar?

The next episode of Garrow’s Law: Tales from the Old Bailey is at 9pm on Sunday on BBC One.