They came into the room one by one, heads bowed, wrists crossed in front of them as if they were used to wearing handcuffs. In one of Syria's most feared military prisons, they told their extraordinary story of helping the armed opponents of Bashar al-Assad's regime. One was French-Algerian, a small, stooped man in his forties with a long beard; another Turkish, with what looked like a black eye, who spoke of his training at a Taliban camp on the Afghan-Pakistan border. A Syrian prisoner described helping two suicide bombers set off a bloody explosion in central Damascus, while a mufti spoke of his vain efforts to unite the warring factions against the Syrian government.

Given the unprecedented nature of our access to the high-security Syrian prison, our meetings with the four men – their jailers had other inmates for us to interview – were a chilling, sobering experience. Two gave unmistakable hints of brutal treatment after their first arrest. It took 10 minutes to persuade the prison's military governor – a grey-haired, middle-aged general in military fatigues – and his shirt-sleeved intelligence officer to leave the room during our conversations. Incredibly, they abandoned their office so that we could speak alone to their captives. We refused later requests by the Syrian authorities for access to our tapes of the interviews.

Two of the men spoke of their recruitment by Islamist preachers, another of how Arab satellite channels had persuaded him to travel to Syria to make jihad. These were stories that the Syrian authorities obviously wanted us to hear, but the prisoners – who must have given their interrogators the same accounts – were clearly anxious to talk to us, if only to meet Westerners and alert us to their presence after months in captivity. The French-Algerian wolfed down a box of chicken and chips we gave him. One of the Syrians admitted he was kept in constant solitary confinement. We promised all four that we would give their names and details to the International Red Cross.

Mohamed Amin Ali al-Abdullah was a 26-year-old fourth-year medical student from the northern Syrian city of Deir el-Zour. The son of a "simple" farming family in Latakia, he sat in the governor's brown leather chair in a neat striped blue shirt and trousers – given to him, he said, by the authorities – and told us he had encountered "psychological problems" in his second year. He twice broke down in tears while he spoke. He said he had followed medical advice as a student but also accepted psychological help from a "sheikh" who suggested he read specific texts from the Koran.

"This was a kind of entrance to my personality and from time to time the second man gave me disks about the Salafist cause, mostly of speeches by Saudi sheikhs such as Ibn Baz and Ibn Ottaimin. Later, he gave me videos that rejected all other sects in Islam, attacking the Sufis, attacking the Shia." The "sheikh" was imprisoned for a year but later joined Mohamed as a roommate in Damascus. "Then he used to show me videos of operations by jihadi people against Nato and the Americans in Afghanistan."

When the uprising began in Syria last year, Mohamed said, he was advised by the "sheikh" and two other men to participate in anti-regime demonstrations. "When Friday prayers were over, one of us would stand in the middle, among the crowd, to shout about injustice and the bad situation; the other four would go to the corners and shout 'Allahu Akbar' [God is great] to encourage the crowd to do the same."

Around this time, Mohamed said, he was introduced to a Salafist called "Al-Hajer" who asked him to help in his movement's "medical and logistic support – to hide men wanted by the authorities and to find safe houses". Al-Hajer began frequenting Mohamed's home, "and he offered me a kind of allegiance, where you shake hands with this man and tell him that you acknowledge him as a leader whom you will obey, and will follow jihad and will not question him". Al-Hajer brought strangers to Mohamed's home.

"They took me into their circle. I left my mind 'outside' at this period and then I recognised that this group was al-Qa'ida. On 10 April this year, one of these people asked me to go with him in a car. I went to a place where I saw cylinders 2.5m high, with cases to fill them up with explosives. There were about 10 people there. I don't know why they asked me there – maybe to drag me into involvement. There was a Palestinian and a Jordanian who were to be suicide bombers and three Iraqi citizens. We left in a car in front of the two bombers. I don't know where they were going to bomb, but 15 minutes after I arrived back home, I heard the explosion and two minutes later there was a much stronger explosion. The catastrophe came for me when I watched the television and saw the bomb had gone off in a crowded street in the Bazzaz district; there were houses crushed in the bombings and all the inhabitants [targeted] were middle class and poor people. I was so sorry."

Later, one of the Salafists asked Mohamed to visit his mother in hospital – because he was a doctor and the Salafist would be recognised – but the Syrian Mukhabarat intelligence service was waiting for him. "I said very frankly to them: 'I am happy to be arrested – better than to get involved in such a group or have a role in wasting more blood.' I don't know how I got involved with these people. I put myself in a kind of 'recycle bin'. Now I want to write a book and tell people what happened to me so that they should not do as I did. But I have not been given pencil and paper."

Mohamed saw his father, a schoolteacher, his mother and a sister two months ago. Was he mistreated, we asked him. "Just one day," he said. "It was not torture." We asked why there were two dark marks on one of his wrists. "I slipped in the toilet," he said.

Jamel Amer al-Khodoud, an Algerian whose wife and children live in Marseille and who served in the French army in the 1st Transport Regiment, was a more subdued man, his 48 years and his rather pathetic tale of a search for jihad – encouraged by al-Jazeera's coverage of Muslim suffering in Syria, he said – leaving him a somewhat disillusioned man. Born in Blida, he had emigrated to France, but though a fluent French speaker, he found only a life of odd jobs and unemployment, until, "after a long hesitation, I decided to go to Turkey and help the Syrian refugees".

He was, he said, a "moderate Salafist", but in the Turkish refugee camps had met a Libyan sheikh, many Tunisians and a Yemeni imam "who gave me lessons in jihad". He crossed the Syrian border with a shotgun, and with other men had attacked military checkpoints and slept rough in abandoned houses and a mosque in the mountains above Latakia. Trained on French weapons, he had never before fired a Kalashnikov – he was allowed to fire three bullets at a stone for target practice, he said – but after several miserable weeks of discovering that a jihad in Syria was not for him, he resolved to walk back to Turkey and return to France. "What I saw on television I didn't see in Syria."

Captured by suspicious villagers, he was taken to a city (probably Aleppo) and then by helicopter to Damascus. Why didn't he choose Palestine rather than Syria for his jihad, we asked. "A Palestinian friend told me his people needed money more than men," he replied. "Besides, that is a difficult border to cross." When I asked him if he had been treated badly in captivity, he replied: "Thank God, I am well." To the same question, he repeated the same answer.

A Syrian imam – of the Khadija al-Khobra mosque in Damascus – with a lean, dark face, told us of his meetings this year with four Syrian "militant groups" in the city which had different nationalist and religious aims, of how he tried to unite them, but discovered that they were thieves, killers and rapists rather than jihadis. Or so Sheikh Ahmed Ghalibo said. Sprinkling the names of these men throughout his conversation, the sheikh said he had been appalled at how the groups had liquidated all who disagreed with them, merely on suspicion, "cutting the bodies up, decapitating them and throwing them in sewage". He said he had witnessed seven such murders; indeed, the disposal of corpses in sewage has been a common occurrence in Damascus.

Knowing that he was a mufti at the al-Khobra mosque and apparently aware that he had met the four extremist leaders, the Syrian security police arrested Ahmed Ghalibo on 15 April this year. He told us he had made a full confession because "these militants are not a 'Free Army'", insisted he had received "very good treatment" from his interrogators, condemned the Emir of Qatar for stirring revolution in Syria, and said he believed he would be released "because I have repented".

Cuma Öztürk comes from the south-eastern Turkish city of Gaziantep, and crossed into Syria after months of training, he said, in a Taliban camp on the Afghan-Pakistan border. He could not speak Pashtu – or Arabic – but had left behind his pregnant wife Mayuda and their three-year old daughter in Gaziantep to travel to Damascus. He spoke only vaguely of jihad but said he had been asked to set up a "smuggling" trail from Turkey to the Syrian capital which would also involve moving men across the border. He was arrested when he visited Aleppo for his mother-in-law's funeral. "I regret all that happened to me," he said mournfully; he was receiving good treatment "now". He asked us to let the Turkish authorities know of his presence in the prison.