A gay lover and henchman of Ronnie Kray operated as an MI5 mole at the heart of the notorious crime empire, new research claims.

Fearful of a Profumo-style scandal, the security service recruited 'Mad' Teddy Smith to gather intelligence on a ring of homosexual politicians and Establishment figures who consorted with Ronnie and his twin brother Reggie.

MI5 allegedly spent years protecting the Krays until they were finally jailed for life for two murders 50 years ago next week.

The claims come from writer Clare Campbell, based on clues in unsealed MI5 files at the National Archives and the recollections of three brothers – Alfie, David and Bobby Teale.

Kray Brothers (pictured, left and right) lieutenant Teddy Smith (middle) may have been an MI5 spy, according to new research

The research says Smith (pictured) gathered intelligence on homosexual politicians for MI5

They knew the Krays and gave evidence against them at their 1969 Old Bailey trial.

Smith, whose 'Mad' epithet was the result of a spell in Broadmoor, was one of Ronnie Kray's lieutenants and they had an on-off sexual relationship.

For decades, he was believed to have been killed by Ronnie in 1967, but separate documents unearthed by amateur historian Ray Rose show he actually fled to Australia where he died, aged 74, in 2006.

The MI5 files studied by Ms Campbell focus on Lord 'Bob' Boothby, a Tory peer, former MP and wartime junior Minister, who was said to share Ronnie Kray's fondness for young boys.

‘It’s obvious from the files that the source is very close to the Krays,’ Ms Campbell told The Mail on Sunday.

‘And there is a warning from MI5 to Special Branch that their man could face “savage reprisals” if his cover were blown. When you factor in the widespread rumours of Smith’s death, which have now been disproved, it’s very persuasive.’

Underworld figures Ronnie (left) and Reggie Kray (right) were allegedly protected by MI5 for many years in the 1960s

David Teale is certain that Smith was a MI5 mole. 'Thinking back, I suddenly realised it had to be Teddy. It was the only thing that made sense,' he said. 'Teddy was always hanging around, always listening to everything that was going on.

'Every time he got nicked, the case would mysteriously collapse, letting Reggie and Ronnie walk.'

Smith, who was portrayed by Taron Egerton in Legend, the 2015 film about the Krays, is long thought to have been strangled by Ronnie in a lovers' quarrel in 1967 before being buried in marshland in Essex.

But Mr Rose, a music promoter fascinated by 1960s gangsters, was tipped off that Smith had actually moved to Sydney.

It was originally thought Ronnie (left) murdered Smith in 1967, however it has been found that he in fact moved to Australia

He travelled to Australia where he uncovered Smith's passport and Australian citizenship letter.

'He never changed his name and I met a family who sort of adopted him,' he said.

'Towards the end of his life, he told them who he really was and they wrote down his recollections. Although he walked away from the Krays, he stayed in London for a few years, so I'm not sure he was exactly on the run.'

Despite his involvement with the Krays, Smith nursed ambitions as a writer and even penned a TV drama called The Top Bunk, which was screened by the BBC in 1967.

Mr Rose is yet to be convinced that Smith worked for MI5.

'I'm not sure about Teddy being the mole, because no one ever suggested that he might be a grass,' he said.

'But it's impossible to be sure.'