A former head of the British army has said Donald Trump is right to say British Islamic State fighters held in Syria should be brought back to the UK because they are the UK’s responsibility.

Gen Lord Dannatt said it was important they are seen to be treated fairly to help prevent others being radicalised and to set an example to the rest of the world.

He told Sky’s Sophy Ridge on Sunday: “Usually I disagree with Donald Trump, but on this occasion I think he’s right.

“If there are … a large number of foreign fighters in captivity in Syria who originate from countries like the UK, then they are our citizens and we have a responsibility to act responsibly towards them. That means they have got to come back to this country.”

The issue arose after Trump asked his European allies to “take back over 800” Islamic State fighters captured in Syria and put them on trial. “The Caliphate is ready to fall,” the US president tweeted. “The alternative is not a good one in that we will be forced to release them.”

Dannatt said British Isis fighters in Syria must be subject to due process. “They have got to be held while they are talked to and if there is sufficient evidence against any of them, or many of them, they have to be put through due process and imprisoned if that is the right thing to do,” he said.

“But I think it is also important that we treat them fairly with justice and tempered with a bit of mercy as well because I think the way we treat them may well have important significance for the way other people view our society.

“We don’t want to see others radicalised and going off overseas in the future. How we treat these people coming back – fairly but firmly – we’ve got to get it right. In this case, Donald Trump is right. They are our responsibility and we have got to take them back.”

Dannatt, who led the army from 2006 to 2009, added that Shamima Begum, who left the UK to join Islamic State as a 15-year-old, should be allowed to return. Begum, now 19 and pregnant, was discovered in a Syrian refugee camp after fleeing Isis’s last stronghold and said she wanted to come back to Britain.

“She can’t stay in a refugee camp in Syria for the rest of her life”, Dannatt said. “It’s not right to say America should take her and other fighters and stick them in Guantánamo.”

The issue has caused a political split in the UK, with Sajid Javid, the home secretary, taking a tough line in his warning that he “will not hesitate” to prevent the return of Britons who travelled to join Islamic State. In contrast, David Gauke, the justice secretary, told Sky News on Saturday: “We can’t make people stateless.”

It is not clear the home secretary has the power to exclude Begum, a British citizen, from returning. On Friday, Alex Younger, the head of MI6, said Britons who went to join Isis were “potentially very dangerous” but cannot be stopped if they want to return to the UK.

Younger said the issue of returnees was an “extremely complex and dangerous problem”. He told journalists at the Munich security conference on Friday: “Anyone who has put themselves in this situation can expect to be questioned and investigated and potentially prosecuted, if they return to our jurisdiction.

“We are very concerned about this because all experience tells us that once someone has been put in that sort of position, or put themselves in that sort of position, they are likely to have acquired the skills or connections that make them potentially very dangerous.”

Since 2015, the government has had the power to bar the return of jihadists under a temporary exclusion order.

But legal experts have said the government would not be able to remove Begum’s British citizenship if she is not a dual national, as that would leave her stateless. The home secretary appears to have been advised that he may be able to because Begum’s mother holds a Bangladeshi passport.