London jihadist Khalid Masood was investigated by British domestic intelligence service MI5 as part of a plot to blow up a military base with a remote-controlled toy car, according to a report.

Masood — who killed four people, including a police constable, in Wednesday’s Westminster attack — was probed six years ago over alleged ties to four al-Qaeda-inspired terrorists, the UK’s Telegraph reported.

In 2013, Zahid Iqbal, Mohammed Sharfaraz Ahmed, Syed Hussain and Umar Arshad, were imprisoned for a total of 44 years after admitting planning to unleash a bomb attack on an army base in their hometown of Luton.

Masood lived near one of the ringleaders when he moved to the British town in 2009 after two stints in Saudi Arabia, the paper reported.

The bodybuilding buff also may have met members of the gang when they began preparing for jihad by joining a local gym, according to the report.

Prime Minister Theresa last week said Masood had been investigated for links to “violent extremism” – but was ultimately deemed to not pose a terror threat.

A fuller picture of Masood’s activities has emerged as authorities worked to figure out how the bright family man transformed into a hard-partying, crack-loving zealot in his community, which an assortment of jihadists called home.

During his time in Luton, Masood also lived close to of Taimour Abdulwahab al-Abdaly, the Iraqi-born Swedish student who blew himself up in Stockholm after becoming radicalized as a college student in the Bedfordshire town, the Telegraph reported.

He also was a neighbor of Abu Rahin Aziz, a jihadist who was killed in an American drone strike in the ISIS stronghold of Raqqa in 2015.

Masood is believed to have came under the radar of intelligence services when he associated with the Luton-based gang that plotted the attack with a remote-controlled vehicle, the paper reported.

MI5 agents bugged the gang members’ vehicles when they learned of a possible attack.

During the sophisticated surveillance operation, the spy agency eventually overheard Iqbal — a married father of two — discussing driving a toy car bearing explosives under the gates of the town’s Territorial Army base.

In one conversation, he was heard telling an accomplice, Ahmed: “At the bottom of the gate, there’s quite a big gap. If you had a little toy car, it drives underneath one of their vehicles or something.”

The group also was overheard talking about a plot to attack MI5 headquarters, a US Air Force base, an English Defence League meeting and a local shopping center.

Ahmed, who lived less than a mile from Masood, led several military-style training trips to Snowdonia and the Brecon Beacons mountain ranges in Wales, where they were monitored as they used logs as mock weapons, according to the paper.

In September 2011, authorities raided the men’s homes and arrested them, just days before the 10th anniversary of 9/11. They were jailed in April 2013 after admitting having been inspired by al-Qaeda.

The ringleaders — Iqbal and Ahmed – were sentenced to 16 years and three months each.

Arshad received six years and nine months and Hussain was given five years and three months.