MOSCOW (Reuters) - A man from Russia’s Muslim Dagestan region has been charged with links to an illegal armed group, a court official in Dagestan said, years after he began helping families persuade sons recruited by Islamic State to renounce the militants and leave Syria.

Kazim Nurmagomedov, 63, was detained in Moscow on Wednesday and transferred to Dagestan where he was formally arrested on Thursday on charges of assisting in a crime related to an illegal armed group in Russia or abroad, the official confirmed.

Nurmagomedov has gained prominence by dissuading young men from joining Islamic State and helping families persuade their sons to leave the group’s ranks in Syria. He also helped his own son Marat quit Islamic State and leave Syria.

Marat, 33, told Reuters in July from Ukraine that he had joined Islamic State in 2013, but two years later had changed his mind.

He walked across the Syrian border into Turkey and finally settled in Ukraine, he said, slipping in unnoticed thanks to a breakdown in intelligence-sharing between Moscow and Kiev after Russia annexed Crimea in 2014.

Everyone in the family had tried to convince Marat, who told Reuters that he had now renounced violent Islamism, to leave Islamic State.

But Marat’s brother Shamil, a businessman in the Moscow region, was arrested for sending money to help him get out of Syria and charged with financing terrorism.

On Wednesday, Kazim Nurmagomedov was detained as he was leaving Shamil’s trial in Moscow, which is still going on, another of his sons, Imagadji, told Reuters.

“Naturally, he (Kazim Nurmagomedov) denies he is guilty,” Imagadji said.

Denis Sokolov, an expert on the northern Caucasus region, said that Kazim appeared to have been arrested at least in part because he had gained prominence with his attempts to dissuade others from joining IS, throwing a spotlight on an issue that might be uncomfortable to Russian authorities.

He said Kazim had befriended many families and encouraged or helped them to try to bring home children who had gone to join Islamic State.

“I don’t know anyone else who has extracted that many people from Islamic State, or stopped such a large number from going to join them in the first place,” Sokolov said.

The official at the court in Dagestan declined to comment further on the charges against Kazim.