Israeli authorities accused him of providing cash and mobile phones to Hamas, but Sherari’s lawyer insists his confession to the allegations was made under illegal coercion.

Haaretz reports Sherari was released when the judge, Lieutenant Colonel Azriel Levy, ruled that his confession to the Shin Bet security service had been forced and was, therefore, invalid.

“There’s no doubt that the defendant’s confession, which was given an hour after the end of his Shin Bet interrogation, was dramatically influenced by the method of interrogation, which also included pained and prolonged shackling, threats, and a blatant exploitation of the defendant’s demonstrated weakness,” Levy said.

Reports describe how Sherari was painfully handcuffed for an extended period and prevented from seeing his lawyer from September 15 until October 6.

According to the Shin Bet indictment, Sherari had agreed to act as a messenger for a Hamas member in Lebanon during visits to the country over the course of a decade.

His lawyer, Ramzi Katilat, insists that this confession had come under duress.

“In the interrogation he made an admission. But what we are saying is that it is untrue. What he said was to satisfy the interrogator, who used illegal pressure. He is saying he is not guilty,” Katilat told the Guardian.

“There are two possibilities now. Either the appeal hearing will approve the order and he will be released to the West Bank until the end of proceedings against him. Or the court will overturn last week’s decision and he will stay in jail,” he explained.

In response to coverage of the case on Israel’s Walla news site, Shin Bet said: “Faiz Sherari was indicted at the Judea military court for grave offences against the security of the region.

“During the procedure being carried out against him, the court, as mentioned, delivered its decision not to hold him in custody until the end of the proceedings, and ordered his release under restrictive conditions.

“An appeal against this decision was filed to the military appeals court, and a decision on the appeal has not yet been delivered.

“Besides the above, it should be emphasised that the allegations of torture during Faiz Sherari’s investigation are baseless and groundless.”

In commenting on the case, the Foreign Office told the Guardian: “We are providing consular assistance to a British national who is being detained in Israel, and will remain in contact with local authorities.”