The Westminster attacker converted to Islam in prison, it has emerged, as police continue to piece together the journey of Khalid Masood from “all-round nice guy”, to violent criminal, to terrorist.

The 52-year-old served several prison sentences for offences ranging from grievous bodily harm, to assault and possession of an offensive weapon dating back to his teenage years.

Violent episodes peppered his life, with one friend recalling Masood admitting he had dreams “about killing someone” 16 years before he murdered four people outside the Houses of Parliament.

One two-year stint in jail came after a racially-fuelled fight outside the Crown and Thistle pub in Northiam, East Sussex, which left a man needing 20 stitches to the face.

Former friend Lee Lawrence tried to pacify Masood that day, but soon found the rage directed at him.

“He had the knife against my throat and he is going, ‘I want some blood, I want some f***ing blood, I want to kill someone’,” the 47-year-old told The Telegraph.

“After he calmed down a bit he was saying, ‘What have I done? What am I doing? I am going for help, I just want blood or I want to kill someone’.

Westminster attack probe : Resident describes police seizing van and cars after Birmingham raid

“He said he was having help, some kind of anger management.”

Mr Lawrence also claimed the father of three told him: “I dream about blood. I dream about killing someone”.

The outbursts were a far cry from the Kent-born schoolboy known as Adrian Ajao, remembered by one classmate as an “all-round nice guy” who was popular, sporty and intelligent.

A childhood friend of the man then known as Adrian Elms said he announced his conversion to Islam after serving a jail sentence.

“When he first came out he told me he’d become a Muslim in prison and I thought he was joking,” Mark Ashdown told The Sun.

“Then I saw he was quieter and much more serious.

“I gave him some cash-in-hand work for a few months as a labourer.

The convicted killer (centre) was remembered as an ‘all-round nice guy’ by former classmates

“He said he needed time to pray and read the Quran - something about finding inner peace."

Mr Ashdown said Masood still showed “flashes of the old Ade” but they were few and far between, with his friend splitting from his former partner and becoming increasingly religious.

It was unclear whether the change came during his imprisonment at Lewes Prison in East Sussex, Wayland Prison in Norfolk or Ford open prison in West Sussex.

Masood’s abrupt religious conversion will fuel concerns about the rising threat of criminals being brought under the influence of hardened jihadis while in prison – a pattern repeated time and again in Europe among Isis militants including those who carried out the Brussels and Paris attacks.

Ministers have announced plans to create specialist units within jails to tackle what a Government-ordered review last year concluded was a ”growing problem“.

Isis recruiters are known to target violent criminals looking for a route to redemption, with more than half of known European jihadis fighting in Iraq and Syria known to have a criminal past.

Experts have also warned that Muslim converts are more susceptible to radicalisation as they lack moderate voices among friends and relatives and do not have the Islamic knowledge to counter Salafist teachings.

Masood’s route to extremism could also have been influenced by two stints working as an English teacher in Saudi Arabia, whose government enforces a fundamentalist form of Islam linked to extremist movements around the world.

In pictures: Westminster attack Show all 9 1 /9 In pictures: Westminster attack In pictures: Westminster attack An air ambulance lands after gunfire sounds were heard close to the Palace of Westminster in London PA wire In pictures: Westminster attack MPs wait until the situation is under control in Westminster. 'The alleged assailant was shot by armed police,' David Lidington, leader of the House of Commons, told the house. BBC News In pictures: Westminster attack Crowds gather in Westminster after shooting incident, which police are treating as terror attack BBC News In pictures: Westminster attack Police were also called to an incident on Westminster Bridge nearby AP In pictures: Westminster attack Early reports indicate the car, which mounted the pavement on Westminster Bridge and mowed into around a dozen people, was the same vehicle which then rammed into the railings of the Palace of Westminster, just around the corner Reuters In pictures: Westminster attack Security sources described the suspected assailant as a middle-aged Asian man, who is understood to have left the car before attacking a police officer with a seven-to-eight inch knife PA wire In pictures: Westminster attack Police have asked people to avoid the immediate area to allow emergency services to deal with the ongoing incident AP In pictures: Westminster attack One woman has died and a number of others, including the police officer, have been hurt, according to a junior doctor at St Thomas' Hospital Reuters In pictures: Westminster attack At least three gun shots were heard by those inside Westminster, and proceedings in the House of Commons have been suspended AP

The Saudi Arabian Embassy in London said Masood “did not appear on the security services’ radar” during stays in 2005/6 and 2008/9.

Theresa May said Masood was the subject of an historical investigation over violent extremism by MI5 but was “not part of the current intelligence picture”, describing him as a “peripheral figure”.

“There was no prior intelligence of his intent, or of the plot,” she added.

Police are also searching for potential accomplices after it emerged that Masood used the messaging service WhatsApp just minutes before his attack, raiding properties in London, Birmingham, Manchester and Wales.

Only one man out of 11 people arrested in the wake of Wednesday’s terror attack remains in custody after two more suspects were released yesterday.

The Metropolitan Police said a 27-year-old man from Birmingham and 39-year-old woman from East London would face “no further action” in the case.

A 58-year-old arrested in Birmingham remains in custody and a 32-year-old woman from Manchester is on bail pending further inquiries.

Seven other people were released with no further action on Friday.

Police conduct a fingertip search near Parliament yesterday (PA)

Scotland Yard’s head of counter-terrorism Mark Rowley said detectives want to understand Masood’s “motivation, preparation and associates” and if he “either acted totally alone, inspired by terrorist propaganda, or if others have encouraged, supported or directed him”.

Isis claimed responsibility for the attack, having called for atrocities in Europe and released detailed instructions on car and knife attacks, although the extent of the group’s involvement remains unclear.

Masood ploughed his car into pedestrians on Westminster Bridge, killing three members of the public including a British mother-of-two on her way to pick up her daughter from school, and an American tourist celebrating his 25th wedding anniversary.

He then crashed the car into railings outside the Houses of Parliament and ran into an entrance, fatally stabbing PC Keith Palmer to death despite his protective vest, before being shot dead.

Calls are growing for security and physical barriers around the Palace of Westminster to be stepped up, although Government officials have praised the response of emergency services.

Muslim faith leaders led a 200-strong peace rally in Birmingham on yesterday, with Dr Waqar Azmi telling the crowd: “Those people who are Daesh and Isis do not define the values that Muslims would hold.

“We refuse now to allow them to misrepresent us, and refuse now to allow them to define us.”

Tens of thousands of anti-Brexit demonstrators also fell silent at Parliament Square in tribute to the victims of the Westminster attack.