MI5 lied to three courts while defending its handling of a misogynistic neo-Nazi state agent who attacked his girlfriend with a machete, the BBC can reveal.
Arguing for secrecy, the Security Service told judges it had stuck to its policy of not confirming or denying informants' identities.
In fact, MI5 had disclosed the man's status in phone calls to me, as it tried to persuade me not to investigate the man - known publicly only as agent X.
The service aggressively maintained its position until I produced evidence proving it was untrue, including a recording of one of the calls.
The BBC can reveal:
MI5 first lied in a court case where the government attempted to block the BBC from reporting on agent X's wrongdoing - and succeeded in banning us from naming the foreign national
The Security Service then repeated the lie to a specialist court, where the woman attacked with a machete - known by the alias Beth - is seeking answers about MI5's handling of its agent
It repeated the lie again to a judicial review, where Beth was challenging the specialist court's decision
A senior officer said he was legally authorised to tell me X was an agent - so MI5 had not stuck to its policy of not confirming or denying agents' identities
The director general of MI5 phoned the BBC's director general to cast doubt on the corporation's original story about agent X, wrongly calling it "inaccurate"
In an unprecedented admission, MI5 has now issued an "unreserved apology" to the BBC and all three courts, describing what happened as a "serious error" and saying "MI5 takes full responsibility".
There will now be pressure on MI5 director general Sir Ken McCallum to explain what he knew, given that the officer said he had been legally authorised to disclose X's role.
It also raises concerns about the reliability of MI5's evidence in the courts and the sustainability of one of its core secrecy policies.
For agents "to keep protecting us, we must protect them and their identities from all those who would do them harm," said Sir Ken - in a statement released after this article was first published.
"The use of agents is difficult, human work that is governed by legislation and tightly overseen," he added.
Beth's case will now head back to the specialist court, which is investigating if the Security Service breached her human rights by failing to protect her from X's abusive and coercive behaviour.
It will reconsider whether it was right to rule that the evidence should be heard in closed sessions which she would not be able to attend.
Beth's lawyer, Kate Ellis from the Centre for Women's Justice, told the BBC: "I think this raises real concerns about MI5's transparency, about whether we can trust MI5's evidence to courts."
MI5's lie can be revealed after the BBC applied to the High Court to report false evidence in a corporate witness statement by a deputy director in the Security Service, known as Witness A.
https://www.bbc.co.uk/news/articles/cew5rwpw579o