Editors Note: This story is the result of a two-year CNN investigative report with terror expert Paul Cruickshank into peace talks held between the Libyan Islamic Fighting Group (LIFG) and the Libyan Government which recently culminated in the LIFG, a militant Jihadist group once close to Osama bin Laden, repudiating al Qaeda. "The Jihadi Code," a documentary on the breakthrough against al Qaeda in Libya, airs on November 15 at 1200 GMT.
Tripoli, Libya (CNN) -- As we first stepped into Libya's forbidding Abu Salim jail we had no idea what to expect.
We'd been negotiating for a year to get in, we'd had meetings in cafes, hotels, on street corners; we'd sent emails, countless text messages and phone calls.
We'd been dealing with Saif al Islam, one of Moammar Gadhafi's sons. He'd promised to help. He was negotiating a peace deal with the former jihadists in the jail that would challenge Osama bin Laden. For a long time it seemed Gadhafi's son was getting push-back from security officials and so we'd waited.
We wanted to see for ourselves how he'd managed to make peace with the very jihadi group that had tried to kill has father and at one time wanted him dead too.
We wanted to know from the jihadists themselves why they were ready to end their armed struggle and why they were prepared to challenge Osama bin Laden's ideology. The stakes were high; it is the first credible criticism of bin Laden by a jihadist group since 9/11. It's what the West has been waiting and hoping for and we wanted to know how it had been worked out.
Suddenly after all the waiting we were finally getting into the jail. It felt somehow surreal. It was around midnight on a hot September evening; the shadows cast by the eerie searchlights added to the sense of uncertainty.
We were entering a maze of towering concrete walls and watchtowers where many of Libya's high-security prisoners are held. A little more than a decade ago the government had brutally put down a revolt here, allegedly killing more than 1,200 inmates in less than 24 hours. It was an atrocity the government has since tried hard to cover up.
But this is where we had to be to get the story that was about to cause an earthquake among radical Islamist groups and pose a direct challenge to al Qaeda.
The men we'd come to meet were hardened jihadists from the Libyan Islamic Fighting Group, one of the biggest and best organized jihadist organizations. At its peak it operated in 17 countries, with fighters trained in Afghanistan, battle hardened in Bosnia. They were the real deal.
They were so well respected in Jihadi circles that bin Laden had been trying to have them join al Qaeda for over a decade. Taliban leader Mullah Omar held their leaders in high regard and bin Laden's deputy praised them openly.
A huge green metal gate on squeaky bare metal rollers slowly and noisily opened -- revealing the bizarre sight of what seemed like a large tea party.
But around the dozen or so tables covered with starched white linen cloths were not casual café goers but experienced jihadists. They sat relaxed in their blue prison-issue boiler suits and chatted amongst themselves as white jacketed waiters laid out nuts, dates, fruit and juice in front of them.
There was an uneasy silence when they first saw us. After so many months of tough negotiating to get in here we'd received a phone call less than an hour earlier telling us to get to the jail "fast", where we were "expected".
The middle aged jailers seemed as nonplussed as us about what was going on. They stood awkwardly to one side until eventually one came forward and told the prisoners to chant.
And in deep, sonorous and apparently well-practiced unison they sing in praise of Moammar Gadhafi. It was incongruous to say the least; the last time the outside world had heard anything from these men was during their assassination attempts on the man they now lauded. But it broke the ice and we began to film.
We were the first journalists ever to set foot inside the jail. If we were going to face hostility now was the time. But it quickly became clear the former jihadist prisoners were as interested to meet us as we were to meet them.
We spent about four hours talking to the prisoners. Only later did Saif Gadhafi's staff tell us they were worried we might only get five minutes.
Each man had a different story, but none had been locked up there for less than a decade. Some had fought in Afghanistan, some had been in fighting group cells in the Middle East and some had only been involved in operations in Libya.
To a man though they told us their past actions were wrong, that they were giving up their fight because it is illegal under Islamic law. When I asked them if they were doing this just to get out of jail they denied it.
Indeed some of their leaders have been in jail close to 20 years and although we didn't get to talk to them directly we were told by other fighting group members that getting out of jail wasn't a factor. They'd been in there so long, they said, that more time behind bars didn't matter. They made the reversal after deep introspection and careful religious consideration.
The prisoners told us they couldn't tell us everything because were still locked up and feared their jailers. But they did insist they were well fed. None looked hungry.
A few weeks after we visited them many of the prisoners were freed, part of the deal they'd made with government, to end their armed fight and be allowed to go home.
When we were told we'd have to leave the prisoners had all been rounded up from the "tea party" and marched off to another part of the jail.
We weren't supposed to film that but we did. It was an odd way to end an even odder experience. Somehow we'd tripped over an invisible threshold.
As the big metal gates squeaked shut behind us, our glimpse into perhaps the most serious challenge to al Qaeda since 9/11 was over.
I was left with a feeling that something profound was taking place. How profound will depend on the prisoners we'd just met keeping their side of the bargain, and the Libyan government keeping its side.