This story is the result of a two-year CNN investigative report. "The Jihadi Code," a documentary on the breakthrough, airs on November 28 at 1730 GMT and November 29 at 1200 and 1930 GMT.
Tripoli, Libya (CNN) -- A recently completed peace deal with an Islamic militant group in Libya will help pave the way for the political opening and economic modernization of Libya, Saif al Islam al Gadhafi, the second eldest son of Libya's leader told CNN in an exclusive interview.
Gadhafi made the remarks as the Libyan Islamic Fighting Group (LIFG) and the Libyan government were successfully completing nearly three years of peace talks which this September saw the LIFG formally end its campaign of violence in Libya and repudiate al Qaeda, which many believe will be a key setback for Osama bin Laden's terrorist network.
"We have enough problems in Libya, we want to fight poverty, we want to upgrade our economy, we want to enhance the standard of living. We have terrible problems with the education system, with the health ... but if we keep fighting each other we are the first victims of terror," Gadhafi told CNN, referring to a fierce insurgency fought by the LIFG against the government which peaked in the mid-1990s and formally ended just weeks ago.
The insurgency had a profound impact on Saif Gadhafi after "they tried to kill my father and also they planned to kill me personally and they did kill a lot of Libyans," he told CNN.
Saif Gadhafi said the threat to the regime from the militants in the 1990s was much greater than reported at the time. "[The LIFG were] very aggressive, extremely dangerous and to be honest with you, during the nineties it was like a civil war here in Libya. It was a hidden one, but in fact it was a civil war. There were clashes and fighting in every city and every village all over the country."
While security operations had degraded the group's operations inside Libya significantly by the end of the 1990s, in recent years Libyan authorities have become increasingly concerned about the emergence of a new generation of militants inside the country, radicalized by the Iraq war. Al Qaeda in Iraq recruitment files, discovered by the U.S. military in a 2006 raid in Sinjar near the Syrian border, suggested that per capita Libyans made up the largest number of foreign-born suicide bombers in Iraq.
Libyan leaders realized they needed to check that momentum. Gadhafi realized he needed the LIFG's help.
He told CNN he did not find it hard to persuade his father of the need for dialogue, despite the fact that the group tried to kill him on several occasions. "He's a politician, he's a leader and he knows that it is very important to engage with those people because, like I said, one day we have to stop this process from being repeated all the time."
Gadhafi slowly won the LIFG's trust, partly by persuading prison officials to improve conditions inside Abu Salim jail where they were held.
His support for an investigation into an alleged massacre at Abu Salim was also key. On June 29, 1996 Libyan security services allegedly killed more than 1,200 prisoners inside Abu Salim, including many LIFG members, as they tried to put down a prison riot that had led to the deaths of several prison guards. In 2004 Gadhafi's father acknowledged for the first time that killings had taken place and affirmed the right of victims' families to seek information about what happened.
In his interview with CNN, Saif Gadhafi went perhaps further than any Libyan official in expressing regret for the events of that day.
"It was a big mistake, it was a tragedy but there was a revolution in the prison because those people are very aggressive, bloody. They captured one guard, killed him and tortured him, they took away for example his eyes. [The security services] were very concerned, they were panicked, they were afraid because those people are very serious people, very aggressive, very aggressive so they decided the best way was to kill them.
"It was a mistake but the situation was very serious and now we are trying to, not to solve but to contain this issue. We compensate the families of the victims, trying to conduct dialogue as you know with the others who are still alive, but what happened happened."
Despite all Saif Gadhafi's efforts the peace process froze in August 2008 after security services refused to reorganize Abu Salim prison to allow the LIFG leaders better access to consult with rank and file members. Read how the deal threatens al Qaeda
For months Saif Gadhafi was unable to persuade the security services to grant these requests. "It was very difficult to convince them that ... these people can be good and we can change them. For them they are enemies they should be erased, " Gadhafi told CNN.
Libyan sources told CNN that at the time Saif Gadhafi was engaged in a power struggle with members of the "old guard" inside the country. Unable to make progress, Gadhafi increasingly spent time outside Libya.
But in April 2009 Gadhafi won a key ally for his reconciliation drive with the LIFG in the form of Abdullah al Sannusi, a very powerful figure within Libya's security services, and was able push through with a reorganization of the prison.
Just a few months later the LIFG completed a text called Corrective Studies that denounced its own violent past. "It's a victory, it was a dream for us to reach that statement," said Gadhafi. "It was a very serious success. Extremely important for us. Can you imagine those terrorists, serious terrorists, changed their minds?"
Cementing the positives for Saif Gadhafi, the leaders of the LIFG publicly apologized to his father in a letter they sent to him on the 40th anniversary of the Libyan revolution. The August 27 letter stated, "we would like to submit our apology for everything we have committed, starting from constructing our secret group and all our actions -- the big ones and the small ones."
Last month Saif Gadhafi was given a powerful new official position inside Libya when he was appointed head of the "Popular Leaderships," a powerful body within the Libyan state.
His father had made clear he needed a position to carry out his reforms within Libya, according to Libyan sources. The move makes it more likely that Saif Gadhafi is being groomed to eventually succeed his father, according to Libyan sources.