TRIPOLI, Libya — Ahmed Abu Khattala – the Islamist militant captured by U.S. forces in Libya over the weekend – did not seem to have the personality for leadership. He was a standoffish oddball, the son of a government employee, who had spent more than a decade in the brutal prisons of ruler Moammar Gadhafi.

But, in the chaotic time after Gadhafi’s fall, Abu Khattala had two credentials that led people to follow him. The prison time was one. The other was a fierce disdain for anyone who had previously worked with Gadhafi’s government.

In a country full of guns and anger, Khattala came to command his own militia. He appeared to be untainted in a country where few leaders had no connections to the hated old leadership.

Commanding a brigade “is a very complicated task, and he is a very simple man,” said Mohamed Abu Sidra, a prominent member of Libya’s General National Congress, who had spent time in prison with Abu Khattala. At the time, Abu Sidra said, he was surprised to hear that Abu Khattala – known in prison as a loner who talked to himself – was in charge of something so big.

Now, Khattala’s militia is blamed for two of the most infamous acts of violence in Libya’s bloody post-revolutionary years. One was the 2011 killing of Gen. Abdul Fattah Younis, a former Gadhafi loyalist who had defected to lead the rebels fighting the ruler.

The other was the reason that Abu Khattala was snatched in a joint Special Operations-FBI mission this weekend. Abu Khattala allegedly served as a ringleader in the attacks on an American compounds in Benghazi in 2012, which left four dead – including Ambassador Christopher Stevens.

By 2012, the formal militia he commanded during the uprising had been dismantled, but people here say he had a core following of mostly young jihadists and Islamists from his neighborhood whom he could rally and that he was giving orders to them on the night of the Benghazi attack.

Since then, however, it appears that the personality that had briefly turned Abu Khattala into a leader had turned him into a loner again.

He was said to move about Benghazi by himself – a reckless decision, because both the Americans and a renegade anti-Islamist general were probably looking for him. Some of the more powerful militias had tried to rein in his movements and put him under their protection, according to one former Benghazi fighter who spoke on the condition of anonymity because of potential backlash.

“His followers are shocked” by the news of his capture, the former fighter said from Benghazi. “They can’t believe it.”

Abu Khattala is apparently in his early 40s; his exact age is unclear. Ali Soufan, a former FBI agent who tracks extremists, said Abu Khattala was born in 1973 in Benghazi. Soufan said he comes from a middle-class Libyan family; his father was a government employee and is now retired. He has a younger brother who was born in 1975 and works in the medical field, Soufan said.

Abu Khattala was arrested in about 1991 by the Gadhafi government for his involvement in Islamist militant activities in Benghazi. Soufan said Abu Khattala spent a long stint in the infamous Abu Salim prison in Tripoli.

He was apparently released in 2004 as part of an amnesty program sponsored by Saif al-Islam Gadhafi, the dictator’s son.

After his release, Abu Khattala had started a small construction company in Benghazi, his neighbor said. In 2012, he told reporters from the Reuters news agency that he did not attend university, had never left the country and was unmarried.

In 2011, a rebellion against Gadhafi began in the east of Libya, where Benghazi is located. Abu Khattala used his local network to collect money for food, clothes and even weapons for the fighters.

Eventually, Abu Khattala took up arms himself. He started a small Islamist militia called Obeida ibn al-Jarrah and later came to ally himself with Ansar al-Sharia, though militia leaders here say that relationship is somewhat murky. That militia, whose name means “partisans of Islamic law,” espouses an extremely conservative Salafist strain of Islam.

“He is a jihadist,” said Adel Hasi, a former rebel commander who last met with Abu Khattala earlier this year to discuss building an Islamic state in Libya. Unlike the rest of the brigades fighting Gadhafi, Abu Khattala “refused to cooperate with any army or police who had defected to the rebels,” he said.

Abu Khattala lived in the family home in the al-Laithi district of Benghazi, known for its unusually large population of Islamist militants, according to locals. The evening of Sept. 11, 2012, brought an unprecedented level of scrutiny to Islamist groups in Benghazi. That night, Islamist militias attacked the U.S. diplomatic mission in the city, then assaulted a nearby CIA compound early the next morning. Abu Khattala has always denied involvement in the Benghazi attacks, but U.S. officials have repeatedly blamed him and Ansar al-Sharia..