Now that Constance Briscoe is behind bars I can tell the tangled tale of the crooked judge, the criminal cabinet minister and his vengeful wife. Briscoe, a barrister and crown court judge, made my divorce one of the messiest in history. She was a neighbour. Her daughter and ours were friends, and we invited her once a year for drinks. She was left by her own partner, Anthony Arlidge QC, roughly when I left Vicky Pryce. The two suddenly became firm friends, plotting revenge through tabloid stories.

Briscoe craved media validation. She kept yellowing news cuttings on her wall. Her misery memoir Ugly had been a bestseller, accusing her mother, Carmen Briscoe-Mitchell, of child abuse. Her mum, now 80, sued for libel, supported by Briscoe's siblings. On that occasion Briscoe won. When she was arrested for perverting the course of justice in my case, it thankfully stopped the repossession of her mother's home to pay the libel fees. After the trial Briscoe was described by her mother as a "liar and fantasist".

Briscoe and my ex-wife wanted to destroy my political career, and were trying to plant a story in the Mail on Sunday that I had swapped speeding points. The journalists worried that this was merely a divorce spat, until Briscoe lied that she knew about the points swapping in 2003, long before any animus from the divorce.

That story later caused the Essex police to turn up at Briscoe's door. She panicked and ran off to the gym. They hung around for four hours until she came home, and she felt obliged to give a false witness statement. This was the key evidence that persuaded the police and the Crown Prosecution Service to prosecute my wife and me. I was convinced that Briscoe had made this up, which is why I went on denying guilt and hoping that I could cause the prosecution case to collapse. Nothing encourages a defence like being fitted up with fake evidence.

Although I was guilty, I justified my denial to myself by saying that it was a relatively minor offence committed by 300,000 other people (according to AA polling), that prosecutions should be based on facts not fantasy, and that we would no longer be able to pursue requests for disclosure about Briscoe's wrongdoing.

My defence team set about proving that Briscoe was lying. We went through months of pre-trial hearings to get the Mail on Sunday to reveal its contact with her and my ex-wife. To protect their "unimpeachable" star witness, the police even took a statement from Briscoe in August 2012 saying she had not talked to the press and was not close to my ex-wife.

At that point alarm bells should have been ringing for police and prosecutors. They should have ditched her, because they had only gone to her in the first place because of what appeared in the Mail on Sunday. But they would then have been left with an embarrassing hole in a case against an ex-cabinet minister. They persisted with Briscoe until October, when we showed the extent of the emails between Vicky, Briscoe and the Mail on Sunday. At that point, the police started to investigate the telephone contact between them.

Between June 2010, when I left Vicky, and October 2012, Briscoe rang or texted Vicky 848 times, and Vicky rang or texted her 822 times. In the month when the speeding story broke in the media Briscoe rang 221 times and Vicky rang 160 times. Because of her sworn denials, Briscoe was bound to be prosecuted.

Ironically, Briscoe was not prosecuted for her key lie about 2003. That would have required Vicky to testify against her, and the prosecutors had trashed Vicky's credibility in her own trial. Instead, Briscoe was accused of lying about her friendship, media contact, and the subsequent cover-up.

Once the judge ruled that there was still a case to answer against me, I decided to plead guilty. I did not want to perjure myself like Jonathan Aitken or Jeffrey Archer, or have an undignified slanging match in court with my ex-wife. I regret committing the offence, but do not regret pleading guilty.

The legal system reached the right conclusions in all three criminal cases, but usually for the wrong reasons. I was prosecuted on the basis of Briscoe's lies. Briscoe was convicted for tangential offences. There were four jury trials (including two mistrials and deadlocked juries) before Vicky and Briscoe were found guilty. The Ugly libel case now looks unsafe.

Briscoe was widely regarded at the bar as a loose cannon. Her mother had complained about her to the bar council, which failed to take action. Briscoe may now cost the CPS dearly in reviews of her past prosecutions. If she was capable of making up evidence against me, she could hide evidence from a defendant to whom she had a duty of disclosure.

There is here a touch of Stafford hospital or Bristol Royal infirmary, where doctors turned a blind eye to rogue or incompetent colleagues. As George Bernard Shaw said, every profession is a conspiracy against the laity. Doctors, teachers, accountants, lawyers – even journalists. No one likes whistleblowing on their own team, but sometimes it is necessary.