LONDON — Two Britons who fought in Syria and were arrested upon returning to Britain after their families cooperated with the police were sentenced to long prison terms on Friday. The case has provoked debate over how to reduce the risk posed by returning jihadists without discouraging their families from cooperating with the authorities.

The two men, Mohammed Ahmed and Yusuf Sarwar, had concealed their plans to travel to Syria in May 2013, but after they left, Mr. Sarwar’s mother found a letter explaining her son’s decision to “do jihad.”

Mr. Sarwar’s family went to the police, and when the men, both 22 and childhood friends from Birmingham, returned to Britain in January, antiterrorism officers were waiting at Heathrow Airport near London.

On Friday, Judge Michael Topolski sentenced the men to 12 years each in prison, saying they had “willingly, enthusiastically and with a great deal of purpose, persistence and determination embarked on a course intending to commit acts of terrorism.”