Between bursts of machine-gun fire and the crump of explosions – unmuffled in crisp mountain air – the starry sky above the Syrian frontier offers ethereal distraction. It's 3am and the town of Tal Kalakh, less than two miles to the north – just inside the Syrian Arab Republic – is under sustained attack, its residents reportedly refusing to hand over a small band of defectors who have holed up there, trying to bolt for Lebanon to join the insurgents.

All around are mountains among which ancient armies have battled for millennia. And below, in besieged Tal Kalakh, a western outpost in the restive governorate of Homs, the Syrian army is once again hard at work, killing its own people. Tal Kalakh has felt the full force of violent repression many times since the Syrian revolt erupted back in March. One day, Tal Kalakh will doubtless appear on the revolutionary roll of honour. For now, this town of 80,000 people doesn't even merit a mention in my guidebook.

"We don't kill our people," President Bashar al-Assad said last week in an American television interview. "No government in the world kills its people unless it's led by a crazy person." Those who dare oppose al-Assad do not think their leader crazy. Crazed, maybe. But today they see straight through him. They're tired of the lies. They have seen too much.

Between late November and early December, I was one of just two foreign reporters granted an official journalist visa to this repressive police state. I spent nine days in Damascus, capital of al-Assad's Republic of Fear, as a guest of the government. There, I encountered an angrily defiant regime, robust and resolute and unapologetic. Earlier in this Arab spring, I spent six weeks in Libya. There are echoes of Gaddafi in the personality cult surrounding al-Assad, but Syria's political and security apparatus is bigger and badder than anything Gaddafi could muster. I do not mean to belittle the suffering of Libyans, but Syria has four times the Libyan population and 10 times the menace.

Over the course of those nine days, I interviewed three government ministers, an army general and the mayor of a rebellious city. I heard nothing but denials that the security forces were shooting, shelling and torturing civilians. The government blames "armed gangs" and "terrorists" and invokes the spectre of Islamist insurgents, just as Gaddafi's henchmen did. And like them, they see western-backed conspiracies. They talk of a media war in which Arab and western satellite TV stations broadcast "lies" and "fabricated videos."

"Do you really think that we would accept torture?" I was asked by a seemingly incredulous Bouthaina Shaaban – presidential adviser and senior government minister – when I challenged her on the persistent allegations, most recently documented in great detail by the UN Human Rights Council's Independent Commission of Inquiry. "Syria has no policy of torture whatsoever," she said. "We do not have Guantánamo or Abu Ghraib. That is absolutely unacceptable by us. Absolutely unacceptable." Every government minister complained of the outside world's anti-Syrian agenda, which overlooked the barbarous excesses of "armed gangs" that, they claimed, had tortured, killed and often dismembered 1,400 Syrian soldiers.

Syria is party to the 1984 UN Convention Against Torture. This convention defines "torture" as any act which intentionally inflicts severe pain or suffering, physical or mental, with the intention of obtaining information, a confession or punishing an individual for something he or someone else has committed or is suspected of committing.

"It's rampant," says Nadim Houry, the Beirut-based deputy director of Human Rights Watch for the Middle East and North Africa, who has taken testimony on hundreds of cases of torture from Syria, "and, the odds are, if you're detained, you will be ill treated and most likely tortured. We know of at least 105 cases of people who were returned from the custody of security services in body bags to their loved ones … and those are only the ones that we know of." Mr Houry says he has evidence that tens of thousands of Syrians have been arbitrarily detained over the months.

"But we have also documented what I would call "meaningless torture" – if there is ever such a thing. They've got all the information but they want to teach you a lesson. I think that lesson is "you need to fear us". And the striking thing that I've seen is that despite that torture, people are no longer afraid. The wall of fear has been broken."

A short drive from the frontier, along hair-pinned mountain roads, past Lebanese checkpoints where friendly soldiers shiver, is a Syrian safe-house. There is no electricity. The place is crammed with refugees; there are children sleeping everywhere. In an upstairs room, next to a small wood-burner, a weathered former tractor driver from Tal Kalakh – who is in his 50s – winces as pains shoot through his battered body, lying on a mattress on the concrete floor. He manoeuvres himself on to a pile of pillows and lights a cigarette. He's relieved to have escaped to Lebanon but he's already yearning to go home. He can't though. His right leg is now gangrenous below the knee; he can barely move. So far he's had only basic medical treatment.

Before sunrise one morning, he told me, as troops laid siege to his town, he'd been shot twice by "shabiha", pro-al-Assad militia. Unable to run, he had been rounded up, thrashed and driven down the road to nearby Homs with many other detainees, being beaten all the way. For the next few weeks, his bullet wounds were left to fester, he says, while he was subjected to torture so extreme that his accounts of what had happened to him left those of us who listened stunned and feeling sick. During his time in detention, he had been passed, he claimed, to five different branches of al-Assad's sadistic secret police, the Mukhabarat.

In flickering candle-light, he told me in gruesome detail of beatings he'd received with batons and electric cables on the soles of his feet (a technique called "falaka"). He had been hung by his knees, immobilised inside a twisting rubber tyre, itself suspended from the ceiling. He had been shackled hand and foot and hung upside down for hours – the Mukhabarat's notorious "flying carpet". Then hung up by his wrists ("the ghost"), and whipped and tormented with electric cattle prods.

When he wasn't being tortured, he had been crammed into cells with up to 80 people, without room to sit or sleep, he claimed. They stood hungry, naked and frightened in darkness, in their filth, unfed, unwashed. He recalled the stench and listening to the screams of others echoing through their sordid dungeon. He told of being thrown rotting food. And of the sobbing of the children.

"I saw at least 200 children – some as young as 10," he said. "And there were old men in their 80s. I watched one having his teeth pulled out by pliers." In Syria's torture chambers, age is of no consequence, it seems. But for civilians who have risen up against al-Assad, it has been the torture – and death in custody – of children that has caused particular revulsion.

The tractor driver told of regular interrogations, of forced confessions (for crimes he never knew he had committed); he spoke of knives and other people's severed fingers, of pliers and ropes and wires, of boiling water, cigarette burns and finger nails extracted – and worse: electric drills. There had been sexual abuse, he said, but that was all he said of that.

Having finished in one place, he'd been transferred to yet another branch of the Mukhabarat and his nightmare would start all over again. And as the beatings went on day in, day out, his legs and the soles of his feet became raw and infected. That was when they forced him to "walk on rocks of salt". He told me, speaking clearly, slowly: "When you are bleeding and the salt comes into your flesh, it hurts a lot more than the beating. I was forced to walk round and round to feel more pain."

He lit another cigarette, then said: "Although we are suffering from torture, we are not afraid any more. There is no fear. We used to fear the regime, but there is no place for fear now." If the intention of torture is to terrorise, it has in recent months had the opposite effect. Each act of brutality has served, it seems, to reinforce the growing sense of outrage and injustice and has triggered ever more widespread insurrection.

I met other survivors in other safe houses and each account corroborated the other. A pharmacist, abducted by militia from a hospital to which he'd been taken after being shot. His experience of torture was every bit as bad as that of the tractor driver. The 16-year-old boy, beaten, electrocuted to the point he thought he would die, then threatened with execution. He was now having trouble sleeping.

Another man, placed in what he called "the electric coffin" – in which a detainee is forced to lie inside a wooden box, across two metal plates through which they pass a current. The 73-year-old man was mercilessly whipped, electrocuted and beaten because of his son's known opposition activities abroad. He talked of hundreds of detainees pushed into cells, humiliated and naked. Another torture refugee told of a device they called "the German chair", so named, apparently, because it was devised by the Stasi. In it, a detainee is bent backwards until he feels his spine will snap.

What emerged was a pattern of systematic brutality, a revolving door of terror through which thousands of people have passed in recent months. This is Syria's torture machine. It is torture on an industrial scale.

While in Syria, we lived in a bubble, seeing nothing of the extreme brutality and killing for which the Syrian regime is so notorious. We were taken to mass rallies, where thousands of frenzied supporters kissed portraits of al-Assad for our cameras and chanted slogans in defiance of Arab League sanctions.

For two days we were not granted filming permits – and it's probably no coincidence that one of those days was a Friday, the day on which hundreds of anti-government demonstrations are guaranteed to break out right across the country after midday prayers. One day, while we were legally filming on a street, our government minder – despite wielding official documents embossed with Ministry of Information double-headed eagles – was arrested by angry Mukhabarat agents. We never found out why this particular location was so sensitive. Our minder returned, visibly shaken, 15 minutes later. "We cannot film here," he said. "Let's go."

Despite daily requests, we were refused access to cities such as Homs and Hama whose residents were posting videos on YouTube showing tanks firing at random into civilian areas. When we were finally taken to Dara'a, the southern city that had been the cradle of this insurrection, we travelled in the presence of four government minders and, when we attempted to talk to anyone, we found ourselves surrounded by Mukhabarat who instructed our interviewees to tell us everything was normal. It was very claustrophobic.

Despite this, an astonishing number of Syrian people did approach us, subtly – and often quaking – to tell us that all was not as it appeared, that they detested the regime and that there were thousands out there like them. One man touched my arm as I stood in the midst of a mass rally in downtown Damascus, completely surrounded by the ranting and raging regime-faithful. As I looked round, he caught my eye and simply uttered the word "Bashar" as he drew his index finger across his throat, before melting into the loyalist crowd. If he'd been spotted he might as well have signed his own death warrant.

A road snakes up the barren rock of Mount Qasioun which overlooks Damascus and on a clear day, from 1,000m up, there's a magnificent panoramic view across the capital. From this vantage point, if you know what you're looking for, it is possible to pick out at least seven locations where you can say with a good degree of certainty that people are being tortured at any single moment. The thought spoils the view.

Each of the four main pillars of the Mukhabarat – military intelligence, air force intelligence, the political security directorate and the general security directorate – has its headquarters in the city. And each has sub-branches: general security has three – including the feared Palestine branch – and military intelligence has several, among them the notorious Branch 235. No one seems to know what the number means. Each of these agencies is an empire inside an empire, with bureaux the length and breadth of Syria. Since the revolt started, detention facilities have not been confined to known intelligence buildings; the Mukhabarat have used stadiums and football fields in several cities to detain and torture suspects. In smaller towns and villages, market squares suffice. The four main intelligence agencies are thought to be directly under the control of the president.

While al-Assad increasingly faces armed insurrection from those weary of life in his Big Brother world, the most potent weapon in opposition hands is the mobile phone. Grainy footage of violent acts of repression – and of those tortured and killed by the regime – has been uploaded and rebroadcast to a global audience of millions.

These videos make distressing viewing. In one, a mother is seen weeping over the body of her 27-year-old son who has been delivered home, dead, after a week in detention. He has marks and bruises all over his body and there is a bullet wound. "May Allah take revenge against all tyrants," the woman wails. "On each and every unjust person, Bashar and his aides, my God, may You take revenge on him."

Such footage has caused irreparable damage to al-Assad's regime. But the government ministers I spoke to about these videos roundly dismiss them as faked or filmed somewhere else at another time. If verified, however, such footage would present important evidence of the crimes the regime now stands accused of by the UN Human Rights Council Inquiry. The sheer volume of such material – upwards of 30,000 videos have now been posted on the internet by Syrian opposition activists – spurred Channel 4 to commission a documentary investigation.

We employed a team of experts to forensically examine video footage, subjecting it to a strict verification protocol. We have independently checked, when possible, the sources of the material, looked for time-specific clues, then examined location details with Syrians from those places. Specific incidents have been cross-checked and corroborated by independent sources. Exiled former members of the Syrian security forces have checked vehicles, uniforms and military insignia. A growing number of these videos show soldiers actually committing acts of torture, openly filming each other. It's chilling: not one of them appears to be worried about being identified.

Accents have been carefully listened to. And the records of those uploading video have been examined for consistency and reliability. We sought the advice of a specialist doctor from the charity Freedom from Torture. We employed a forensic pathologist, Professor Derrick Pounder, to examine grim video evidence of those whose relatives allege were killed under torture.

The result is a grotesque compendium of verified video material which we believe to present irrefutable prima facie evidence of crimes against humanity.

Talking me through this material, Pounder said the videos show "compelling evidence of crude physical violence, strangulation, homicide, shootings and general assaults. There is a very distinctive pattern of … physical violence in an extreme form," he said. "It would suggest that what was happening was happening on a wide scale and it would suggest that what was happening was carried out with impunity … There is no consequence for them even if there is clear evidence of an assault." So much for the UN Convention Against Torture.

One evening, when I was interviewing torture victims in a Syrian safe house in Lebanon, there was a great commotion. A Syrian army defector, who had commanded resistance in the district of Baba Amr in Homs – the city Syrians have dubbed "Capital of the Revolution" – was being carried into the safe-house by four men. He had been shot nine times and had somehow survived, but he was in terrible pain. He had recently been smuggled into Lebanon from Tal Kalakh.

The next morning, he was well enough to talk briefly. It was my first encounter with a former member of the Syrian security forces. He told me that mass detention and severe torture were commonplace. "When the army carries out a detention campaign," he said, "they start to torture the detainee until the security services arrive. They then take him to the military security branch, which is like a human slaughter house. Most of the people taken there alive are discharged dead."

While a platoon commander in the army he had accompanied officers in house-to-house searches for wanted men in Homs, he said. "When they don't find their target, they either rape the women, or kill the children." He named the officers in charge and his commanding officer. They were all Allawites, he said – members of the prominent Syrian Shia sect to which the president belongs. When they had failed to find one man on their wanted list, he claimed, they had taken his son, beheaded him and hung his head above the door of the family home. He related this account in a faltering manner as though struggling to find the words, and as he did so, tears rolled down his face. But he was so badly wounded, he couldn't wipe the tears away. This, he told me, was what had prompted his defection.

I told him that the UN had just raised its estimated death count to 4,000 civilians killed since March. (This week they raised that to 5,000.) He looked at me in disbelief. He said the number was much higher. After four decades of al-Assad rule, one man is held accountable for this bloody-thirsty repression: the army's commander-in-chief and the head of Syrian Intelligence – the president of the republic himself. And if al-Assad was to attempt to stop all this, could he, I asked Nadim Houry. "I don't know the answer to that," he said. "But I do know that he never tried to stop it."

Syria's Torture Machine, 19 December, 11.10pm, Channel 4. To watch the programme and for more information visit: http://www.channel4.com/programmes/syrias-torture-machine