With ISIS on the brink of being flushed out of Iraq and Syria, experts suggest militants returning to the West may want to be sent to prison where they can set up what is being described as jihadi universities to spark a new movement.

It is also predicted Islamic State could then re-emerge from the ashes under a new name and with a fresh army of brainwashed jihadis once the group is effectively destroyed in the Middle East.

After 51 jihadist attacks in Europe and the US in the last three years, two separate studies have reported three quarters of the terrorists were homegrown.

Both pointed to a shift in the Islamic State movement, with less of an emphasis on the foreign fighter and more concern brewing over extremists attacking their own countries.

A man suspected of being an Islamic State militant is detained by the Iraqi Army in the Old City district on July 10, 2017 in Mosul, Iraq. The Iraqi government and armed forces have declared victory but fighting continues

A picture taken on July 9, 2017, shows a general view of the destruction in Mosul's Old City.Iraq will announce imminently a final victory in the nearly nine-month offensive to retake Mosul from jihadists, a US general said Saturday, as celebrations broke out among police forces in the city

In a security policy brief published by the Royal Institute for International Relations, Thomas Renard claims the modern jihadi in Eutope is homegrown, leaderless and virtual.

Renard said: 'Returnees are likely to play a key role in the recruiting and training of the next jihadi wave.

'It is therefore imperative to monitor them very closely, and seek to limit their influence as much as possible.

'That work starts imperatively in prison, where a number of them are already detained or heading in that direction

Prisons have always been an incubator for radicalisation and violence, but there are many indications that the problem is growing out of proportion.

Khuram Butt, 27, a British citizen who slaughtered innocent people in London

'Some recruiters seem to see jail as jihadi universities, while programmes focusing on counter-radicalisation, deradicalisation or disengagement remain underdeveloped in prison.'

He said the terror group's constant weakening position in former strongholds such as Mosul and Raqqa, there is a growing number of militants looking to turn their backs on ISIS.

Renard found some fighters would now be looking for redemption and reintegration into the society in their homelands, but he predicted many would fall back into violent extremism years later.

He claims that brings with it a rising threat - the homegrown jihadi.

Fighting in Syria has lost its appeal with a massive number of senior ISIS figures killed by allied forces and the terror group losing its grip on territories.

Instead, militants are turning their attention to the West.

And with Europe tightening its border controls, it has turned the continent into forbidden fruit for some extremists hell bent on wreaking havoc.

Those who do manage to get into mainland Europe, either forcibly or voluntarily, could be hoping they get sent to jail.

Final moments: Khuram Butt died on his back with armed officers training their weapons on him - across the road his jihadi friends also lie dead

Police in control: All three men are left dead on the ground outside Borough Market after being hit by a hail of 50 bullets

Greater Manchester Police released this image of a CCTV still of Salman Abedi (circled), the bomber in the Manchester Arena terror attack

Renard said: 'Since 2012, Western intelligence services had feared that young Europeans travelling to Syria and Iraq would return home and pose a security threat.

'Now, security officials confess that what worries them most is unidentified homegrown radicals, initiating a killing spree with an everyday weapon, such as a knife or a car – or even homemade explosives, such as in Brussels recently.'

The same could be said of all three Islamic terror attacks in the UK this year.

On March 22, Khalid Masood killed five people when he ploughed a hire car into pedestrians on Westminster Bridge before launching a knife attack in the capital.

Just over two months later on June 3, a copycat attack on London Bridge claimed the lives of eight victims when Khuram Butt, Rachid Redouane and Youssef Zaghba used a van and knives to slaughter people in Borough Market.

It came days after Salman Abedi blew himself at Manchester Arena using a homemade bomb killing 22 Ariana Grande fans who were piling out of the venue on May 22.

Hundreds more were injured and all attackers apart from Zaghba were British citizens.

It mirrors the global picture, with 73 percent of Islamic terrorists attacking the country in which they are citizens in attacks on the West since June 2014.

Salman Abedi, the Manchester Arena attacker

Another 14 percent were either legal residents or legitimate visitors from neighboring countries, according to a report published in part by The Hague and 5 percent were refugees or asylum seekers at the time of attack.

Just six percent were residing in the country illegally at the time of the attack.

Of the 51 attacks, 17 were in France, 16 in the US, four in the UK, three in Belgium and Canada and one each in Denmark and Sweden.

The death toll stands at 395 in total with 1,549 injuries meaning the average fatalities per attack is 7.7 and the average age for an attacker is 27.3.

A huge proportion of those killed were in France - 239 - mainly due to the 130 who died in the horrendous Paris attacks in November 2015.

What has become a recent trend is authorities admitting retrospectively that attackers were on their radar.

At least 57 percent had a prior criminal record and 17 percent of attackers were converts to Islam.

Another common theme with the terror attacks it for ISIS to come out and claim responsibility for the atrocities.

Jihadist groups, almost always ISIS, claimed 38 percent of the attacks, but 42 percent of attackers had a clear operational connection to an established jihadist group, again in most cases the Islamic State, according to the study Fear Thy Neighbour: Radicalisation and Jihadist Attacks in the West.

The report was published jointly by George Washington University’s Program on Extremism, the Italian Institute for International Political Studies (ISPI) and the International Centre for Counter-Terrorism – The Hague (ICCT).

It also found that 63 percent of attackers pledged allegiance to a jihadist group, almost always the Islamic State, during or before the attack.

US scholar Brian Jenkins said until just recently, youngsters wanted to be part of a jihadi group which ordered them to kill.

But now, they seek to kill in order to be part of the jihad, even if it means they kill themselves.