ROME (Reuters) - Italy's government said on Thursday it would try harder to combat Islamist radicalization in its prisons and on the internet and it defended plans to build more detention centers for migrants who have no right to stay in the country.

New Prime Minister Paolo Gentiloni has come under increased pressure to tackle illegal migration and radicalization in jails after a failed Tunisian asylum seeker who spent time in an Italian prison drove a hijacked truck into a Berlin Christmas market on Dec. 19, killing 12 people.

Italy's anti-terrorism chief said last week the suspect, Anis Amri, had been radicalized while in a Sicilian jail. Islamic State claimed responsibility for the attack. Amri was shot dead by Italian police in Milan on Dec. 23 after fleeing Germany.

"Processes of radicalization today are happening above all in certain places: in prisons and on the web," Gentiloni told a news conference after talks with an expert commission appointed by the government to study militant Islamists.

"Working on prisons and the web is one of the principal tasks the experts are asking for in this prevention effort."

Italy's Interior Minister Marco Minniti told the same news conference he wanted a "protective network against the malware of terror" online, but gave no details on how the government planned to address the problems in jails.

"FERTILE GROUND"

The national prison workers' union said in a statement that jails had become "a fertile ground" for jihadists to recruit weaker individuals to fight for them and said union members should receive foreign language lessons and courses on religious awareness to better tackle the challenge.

"It is not by chance that many radicalized common criminals, especially of North African origin, who showed no particular religious inclination when they entered prison, are gradually transformed into extremists under the influence of other inmates who are already radicalised," the union statement.

Italy tried to deport Amri after he served his four-year jail term, but Tunisia refused to take him back and he was released with only an order to leave the country.

Italy has not suffered the type of militant attack seen in France, Belgium and Germany, but has expelled 133 suspected militants in the past two years.

Of more than 27,000 expulsion orders handed out in 2015 to immigrants with no right to stay, fewer than 5,000 were carried out, according to Eurostat.

Italy is already struggling to deal with record numbers of boat migrants arriving mostly from north Africa.

"We need ... more effective migration policies that combine the great humanitarian inclination to rescue and house people ... and rigorous and effective repatriation policies," Gentiloni said.

Commenting on plans to build more detention centres to hold people ahead of deportation, Minniti said he aimed to allocate smaller numbers of migrants to more locations, thereby reducing pressure on overcrowded sites where protests have broken out.

Opposition politicians have criticised Minniti's plan to open more detention centres, a system repeatedly criticised for alleged corruption and human rights abuses.

"It would only slow down expulsions of illegal immigrants and would increase waste, illegality and mafia groups," said the anti-system 5-Star Movement.