Correction: An earlier version of this article misstated the first name of a Libyan rebel commander. He is Abdulhakim Belhadj, not Abdelkarim Belhadj. This version has been corrected.

Documents unearthed from the archives of Libya’s security service show the former government deeply worried about an Islamist threat to the regime, concerns that reverberated this week as veteran jihadists claimed credit for leading last week’s rebel takeover of Tripoli.

The documents, obtained by The Washington Post, reveal new details about ousted leader Moammar Gaddafi’s years-long campaign to eradicate Islamist militants whom he perceived as plotting his overthrow. Gaddafi’s powerful Interior Security Agency kept close tabs on hundreds of Libyan Islamists, including some who had been fighting against U.S. forces in Iraq and Afghanistan.  

In the records, Libyan security officials elaborately map the movements of suspected al-Qaeda fighters and regularly share information on Islamist cells with foreign intelligence agencies.

“We have to fight these people,” one security official, Abu Mounir, argues in a 2006 document, part of a trove found in the agency’s Tripoli headquarters. In an indication of close cooperation with Americans on counterterrorism, he proposes urging Gaddafi to “press the Americans on pushing these governments to take harsher action.”

The documents were uncovered days after the regime fell to rebel fighters led in part by a self-proclaimed former Islamist, Abdulhakim Belhadj. He has declared himself the leader of the “Tripoli Brigade” that spearheaded the defeat of Gaddafi loyalists in the capital. Belhadj is the former commander of the Libyan Islamic Fighting Group (LIFG), an Islamist organization that fought alongside Afghan insurgents against Russian occupation in the 1980s.

After his arrest in Afghanistan in 2004, Belhadj was briefly interrogated by the CIA in Thailand — where it ran a secret prison — before being handed over to Libya, then an ally of the United States in counterterrorism.  Bel­hadj’s organization is believed to have maintained two training camps in Afghanistan before 2001, and it was listed by the State Department as a terrorist organization.

Islamist fighters, some of them veterans of the Iraq and Afghanistan conflicts, are known to have had a key role in the Libyan uprising, sometimes battling alongside secular Libyans under the banner of the Transitional National Council.

The LIFG has long denied being associated with al-Qaeda, and Belhadj has promised that he wants a free and democratic Libya. He was imprisoned for years by Gaddafi.

U.S. officials on Tuesday did not dispute Belhadj’s Islamist roots but played down the connections.

“Some members of LIFG in the past had connections with al-Qaeda in Sudan, Afghanistan or Pakistan, and others dropped their relationship with al-Qaeda entirely,” said a senior U.S. official who closely tracks Islamist terrorist organizations. “It seems from their statements and support for establishing a democracy in Libya that this faction of LIFG does not support al-Qaeda. We’ll definitely be watching to see whether this is for real or just for show.”

The official insisted on anonymity in discussing sensitive case files about terrorist organizations.

A second U.S. official cast doubt on Belhadj’s public assertions that he was the head of the Tripoli Brigade, but said Islamists played an undeniable role in the uprising.

“The TNC is aware of the fact that there are Islamic militants in its midst, and one should not be surprised that they had a prominent role in the fighting,” said the official.

“This is a fine balancing act for the TNC, as they have to deal with the concerns of the West as well as their own concerns,” the official added. “They don’t want an Islamist takeover of the revolution they worked so hard to carry out.”

Gaddafi and his son Saif al-Islam Gaddafi often emphasized the role of Islamists in order to drive a wedge between the Libyan opposition and the West.

Most Libyans practice a conservative form of Sunni Islam. A constitutional declaration made by the rebel council states that Libya will be a democratic state and that “Islam is the religion of the state and the principle source of legislation is Islamic Jurisprudence.” But it also says that the state will guarantee the rights of non-Muslims.

Correspondent Leila Fadel in Benghazi contributed to this report.