An MI5 spy used his status to terrorise his partner before moving abroad to continue intelligence work while under investigation, the BBC has found.
A video shows the man threatening to kill the woman and attacking her with a machete.
The foreign national cannot be named, despite evidence he is a threat to women, after the government took the BBC to court to block publication.
Evidence shows that he is a right-wing extremist with a violent past.
In an unprecedented legal battle, the corporation argued that women had a right to know his identity and it would protect potential victims from harm.
But the BBC successfully resisted the government's attempt to stop publication of the wide-ranging investigation.
Beth, a British national, met the agent on a dating site. The couple went on to live together in the UK.
At first, she says, he was "charming". They appeared to have a lot in common.
But over time, he was revealed to be a misogynist and extremist, obsessed with violence and cruelty. Beth - not her real name - says he sexually assaulted her, and was also abusive and coercive.
She says he used his position with the British security services to terrorise her.
"He had complete control. I was a shadow of who I am now," she says.
As the relationship became more abusive, Beth's mental health deteriorated.
"At the end of the relationship he dictated my every waking hour - where I went, who I saw, how I worked, what I did at work, what I wore."
X made her "feel absolutely worthless" and used "the fact that I had mental health problems to bully me and to make me feel more vulnerable".
He collected weapons and made her watch terrorist videos of executions and murders, she says.
"There was so much psychological terror from him to me, that ultimately culminated in me having a breakdown, because I was so afraid of everything - because of how he'd made me think, the people that he was involved with, and the people who he worked for."
She says X told her that he worked as a paid informant for the British security services - an agent or covert human intelligence source (CHIS), to use the formal term - infiltrating extremist networks. She was aware that he was having meetings with his handlers, receiving money, and being given equipment.
Initially, she said, he kept his real name hidden from her. Our investigation has established that X spent years working as a CHIS for MI5, using several aliases.
The security service runs agents in terrorist networks, informants who secretly work with their handlers, MI5 officers. Controversial powers authorise its agents to commit crimes as part of their cover, but only to access life-saving intelligence, disrupt more serious crime, or ensure an agent's safety.
But this should not cover actions in their private lives.
She says he told her she wouldn't be able to report his behaviour because of his status.
"It meant that I couldn't speak out about any of his behaviour towards me, any of the violence I went through, sexual or physical, because he had men in high places who always had his back, who would intervene and who would actively kill me, if I spoke out."
X was paid to inform on networks of right-wing extremists, but evidence we've seen shows his own alarming views are genuine.
Beth says X praised various white supremacist mass murderers and stated his intent to commit similar acts.
At home, his violence was directed towards Beth. In one video, the MI5 agent is seen attacking her with a machete.
The incident was filmed by Beth on her mobile phone. In the lead-up to the attack, she is heard voicing concern about being killed and saying his treatment of her was unacceptable.
X states he will kill her, leaves the room, and returns holding a machete - which he then raises above her head.
When she is heard telling him the film could be handed to police, X launches an attack with the weapon and his fists. The video cuts out amid her screams.
She manages to fight him off, but he tried to attack her again hours later with a knife, attempting to cut her throat. She says she bit his hand in order to stop him.
Police visited their home after the attack, but our investigation has uncovered serious issues with the response.
X was arrested, charged with assaulting Beth and appeared in court. However, while he was at court, the Crown Prosecution Service (CPS) dropped the case.
Beth says X returned to the property and continued to mistreat her.
The police did not take a full statement from Beth or obtain the video of her being attacked. The CPS quickly discontinued the prosecution.
The police force concerned and the CPS insist the case was discontinued due to lack of evidence.
After returning home, Beth says X claimed the security services would support him and that she was "nothing".
A separate video, covertly filmed by Beth, captured exchanges in which X suggested she might get killed for asking too many questions.
In the video, Beth asks if he will be the one to kill her. His reply implies that he had almost done just that during a previous violent episode.
Lounging smugly on a sofa, he continues: "It's constantly in me. This murderous thing is always in me.... I always imagine how I bludgeon someone to death... It's always been me.... I've been doing it since I was like six... I'm overly aggressive, I know that myself."
The couple would not remain together for much longer - X threw Beth out of their property and disappeared while another investigation against him was ongoing.
During a search of the home after the machete attack, local police officers had discovered extremist material - including X's personal Nazi paraphernalia.
The BBC has seen a police log showing the evidence found by officers, such as a private diary in which X had written about killing "Jews". He had also written about killing Beth.
Local officers called in counter-terror detectives, who in turn seized various items. A terrorism investigation into X ensued, but he left the UK while it was ongoing.
Within weeks of him leaving, Beth had a mental breakdown and was hospitalised.
While she was there, items of hers that had also been seized by counter terror officers were returned to a member of her family by a man who did not identify himself. The relative assumed the man was an associate of X. Neither Beth nor her family knew of the terrorism investigation.
The family were disturbed by this visit - concerned about how the stranger knew the address and came to have Beth's possessions.
We have established the visitor was an MI5 officer. Material seized by a police investigation, under a police warrant, had been given to MI5.
The highly unusual move is consistent with interference in a criminal process by the security service. X's own items were also handed by police to MI5, it is understood.
Counter terror police say no criminality was identified during their enquiries, but have apologised for the fact Beth's possessions were not passed directly to her.
Following her release from hospital, Beth complained to the local police force, asking why the case was dropped, why her property was taken, and why it was returned by a stranger.
Police took a year to interview her, but have since claimed there is nothing to look into as everything was investigated previously. It was not.
During the course of a complaint process with the police, Beth was told the force did not hold information about her property being seized but could see from "notes" that some property had been taken and returned to X. Police said they did not seize any items as part of their own investigation, and were "unable to advise when or why these were taken".
This was untrue, as the police force concerned was responsible for calling in counter terror officers.
The police claim that property had been returned to X was also untrue - the material had been given to MI5.
We have established that, after X disappeared, he moved abroad and began working for a foreign intelligence agency.
But X also has a history of appalling abuse in that country - with his extremist and violent behaviour long predating him becoming an MI5 agent.
We located and spoke to a former partner in the same foreign country. Her account of X's behaviour is equally alarming as Beth's. The two women have never met or communicated.
Ruth - not her real name - says X seemed normal at first, but he eventually began abusing and terrorising her.
He also threatened her life and that of her child.
"He said he would be able to kill me and my daughter, too, and then put our bodies somewhere and no-one would ever know who I am."
Fearing for her safety, she sought help from a medical organisation and was taken to a refuge. The trauma had left her unable to even speak at the time, and she was admitted to hospital.
"I was psychologically broken, really broken," she says.
"I kept wondering why he changed so much, but he once told me that this is his true face and that he'd been acting the whole time."
We tracked down a professional who had helped care for Ruth. He corroborated her account and described the events as perhaps the most disturbing he has ever encountered.
He remembered a notebook in which X had set out his desire to kill. Ruth separately described the same item, saying it contained fantasies involving "blood, bones, flesh. Human flesh. Eating children's flesh".
And he threatened to kill and sexually abuse female children known to Ruth. He would later make the same threats to Beth.
Police in the foreign country were made aware of X and the threat he posed.
In a disturbing echo of the way he later abused his MI5 connection, X had used the spectre of a criminal organisation to which he was linked to terrify Ruth, telling her its members could have her killed.
X eventually disappeared, leaving her only his financial debts.
We've found he subsequently spent years in Britain using her name, as a way of hiding his real identity, while in the pay of MI5.
"I think it's not fair and I'm angry," Ruth says. "I'm very hurt. I feel cheated. You can't have trust. There is no justice."
Our investigation found evidence independent of both women that corroborates their descriptions of X.
We obtained writings in the which X boasted about severely sexually exploiting women - using language that is too offensive to repeat.
In other writings, he expressed approval for a young girl being raped and murdered.
He openly joined a site, looking for British women, under an alias used for his MI5 work. Consistent with this, Beth says he had described searching online for women to exploit.
Given the BBC was able to establish that X had a history of violence and abuse, MI5 should, similarly, have been aware.
Last year a serving police officer grossly exploited his position to coerce, rape and murder Sarah Everard.
There was overwhelming public concern - also voiced by government ministers - about how such a tragedy could have occurred, as well as about the state's wider response to violence against women and girls.
An inquiry into her death has been announced, with the home secretary saying it "will shine a light on the failings that allowed a serving police officer to abuse his power in such a horrific manner and make recommendations for change within policing".
The warning signs displayed by X are stark. Both of the women we interviewed think he is capable of murder.
But, when we put our findings about X to the government, it took us to the High Court, trying to stop this story being made public.
The court legally prevented us from naming X, because of an apparent risk to him from other extremists.
The government said it "will not comment on security or intelligence", but the court order is "aimed at protecting national security and avoiding a real and immediate risk to life, safety and privacy."
However, the BBC wanted to identify X so that women he is in contact with already, or those who meet him in future, could be warned.