BENGHAZI, Libya — A boyish-looking U.S. diplomat was meeting for the first time with the
Islamist leaders of eastern Libya’s most formidable militias.

It was Sept. 9, 2012. Gathered on folding chairs in a banquet hall by the Mediterranean, the
Libyans warned of rising threats against Americans from extremists in Benghazi. One militia leader,
with a long beard and mismatched military fatigues, mentioned time in exile in Afghanistan. A U.S.
guard discreetly touched his gun.

“Since Benghazi isn’t safe, it is better for you to leave now,” Mohamed al-Gharabi, leader of
the Rafallah al-Sehati Brigade, recalled telling the Americans. “I specifically told the Americans
myself that we hoped that they would leave Benghazi as soon as possible.”

Yet as the militiamen snacked on Twinkie-style cakes with their American guests, they also
gushed about their gratitude for President Barack Obama’s support in their uprising against Moammar
Gadhafi. They emphasized that they wanted to build a partnership with the United States, especially
in the form of more investment.

The diplomat, David McFarland, a former congressional aide who had never before met with a
Libyan militia leader, left feeling agitated, according to colleagues. But the meeting did not
shake his faith in the prospects for deeper involvement in Libya. Two days later, he summarized the
meeting in a cable to Washington, describing a mixed message from the militia leaders.

Despite “growing problems with security,” he wrote, the fighters wanted the United States to
become more engaged “by ‘pressuring’ American businesses to invest in Benghazi.”

The cable, dated Sept. 11, 2012, was sent over the name of McFarland’s boss, Ambassador
Christopher Stevens.

Later that day, Stevens was dead, killed with three other Americans in Benghazi in the most
significant attack on U.S. property in 11 years, since Sept. 11, 2001.

The cable was a last token of months of American misunderstandings and misperceptions about
Libya and especially Benghazi, many fostered by shadows of the earlier Sept. 11 attack. The United
States waded deeply into post-Gadhafi Libya, hoping to build a beachhead against extremists,
especially al-Qaida. It believed it could draw a bright line between friends and enemies in Libya.
But it ultimately lost its ambassador in an attack that involved both avowed opponents of the West
and fighters belonging to militias that the Americans had taken for allies.

Months of investigation by
The New York Times, centered on extensive interviews with Libyans in Benghazi who had
direct knowledge of the attack there and its context, turned up no evidence that al-Qaida or other
international terrorist groups had any role in the assault. The attack was led, instead, by
fighters who had benefited directly from NATO’s extensive air power and logistics support during
the uprising against Gadhafi. And contrary to claims by some members of Congress, it was fueled in
large part by anger at an American-made video denigrating Islam.

A fuller accounting of the attacks suggests lessons for the United States that go well beyond
Libya. It shows the risks of expecting U.S. aid in desperate times to buy durable loyalty, and the
difficulty of spotting friends among allies of convenience in a culture shaped by decades of
anti-Western sentiment.

The attack also suggests that, as the threats from local militants in the region have
multiplied, an intense focus on combating al-Qaida might distract from safeguarding U.S.
interests.

In this case, a central figure in the attack was an eccentric, malcontent militia leader, Ahmed
Abu Khattala, according to numerous Libyans present at the time. U.S. officials briefed on the
criminal investigation into the killings call him a prime suspect. Abu Khattala declared openly and
often that he placed the United States not far behind Gadhafi on his list of infidel enemies. But
he had no known affiliations with terrorist groups, and he had escaped scrutiny from the 20-person
CIA station in Benghazi that was set up to monitor the local situation.

Abu Khattala, who denies participating in the attack, was firmly embedded in the network of
Benghazi militias. Many other Islamist leaders consider him an erratic extremist. But he was never
more than a step removed from the most influential commanders who dominated Benghazi and befriended
the Americans. They were his neighbors, his fellow inmates and his comrades on the front lines in
the fight against Gadhafi.

Fifteen months after Stevens’ death, the question of responsibility remains a searing issue in
Washington, framed by two contradictory story lines.

One has it that the video, posted on YouTube, inspired spontaneous protests that got out of
hand. This version, based on early intelligence reports, was initially offered publicly by Susan
Rice, who is now Obama’s national security adviser.

The other, favored by Republicans, holds that Stevens died in a planned assault by al-Qaida to
mark the anniversary of its strike on the United States 11 years before. Republicans have accused
the Obama administration of covering up evidence of al-Qaida’s role to prop up the president’s
claim that the group has been decimated.

The investigation by
The Times shows that the reality in Benghazi was different, and murkier, than either story
line suggests. Benghazi was not infiltrated by al-Qaida, but it contained grave local threats to
U.S. interests. The attack does not appear to have been carefully planned, but neither was it
spontaneous or unforeseeable.

Abu Khattala had become well known in Benghazi for his role in the killing of a rebel general,
and then for declaring that his fellow Islamists were insufficiently committed to theocracy. He
made no secret of his readiness to use violence against Western interests. One of his allies, the
leader of Benghazi’s most overtly anti-Western militias, Ansar al-Shariah, boasted a few months
before the attack that his fighters could “flatten” the U.S. Mission.

The violence, though, also had spontaneous elements. Anger at the video motivated the initial
attack. Dozens joined in, some of them provoked by the video and others responding to false rumors
that guards inside the U.S. compound had shot Libyan protesters. Looters and arsonists, without any
plan, were the ones who ravaged the compound after the initial attack, according to more than a
dozen witnesses, as well as U.S. officials who have viewed the footage from security cameras.

The Benghazi-based CIA team had briefed McFarland and Stevens as recently as the day before the
attack. But the U.S. intelligence efforts in Libya concentrated on the agendas of the biggest
militia leaders and the handful of Libyans with suspected ties to al-Qaida, several officials who
received the briefings said. Like virtually all briefings over that period, the one that day made
no mention of Abu Khattala, Ansar al-Shariah or the video ridiculing Islam, even though Egyptian
satellite television networks popular in Benghazi were spewing outrage against it.

Members of the local militia groups the U.S. called on for help proved unreliable, even hostile.
The fixation on al-Qaida might have distracted experts from more imminent threats.

More broadly, Stevens, like his bosses in Washington, believed the United States could turn a
critical mass of the fighters it helped oust Gadhafi into reliable friends. He died trying.

After the attack, Obama vowed retribution. “We will not waver in our commitment to see that
justice is done for this terrible act,” he said on television from Washington on the morning of
Sept. 12. “And make no mistake, justice will be done.”

But much of the debate about Benghazi in Washington has revolved around statements made four
days later in television interviews by Rice, who was then ambassador to the United Nations. “What
happened in Benghazi was in fact initially a spontaneous reaction to what had just transpired hours
before in Cairo,” she said on NBC’s
Meet the Press, “almost a copycat of the demonstrations against our facility in Cairo,
prompted by the video.”

Republicans, pouncing on the statement, have argued that the Obama administration was trying to
cover up al-Qaida’s role. “It was very clear to the individuals on the ground that this was an
al-Qaida-led event,” Rep. Mike Rogers, R-Mich., the chairman of the House Intelligence Committee,
said last month on Fox News.

But the Republican arguments appear to conflate local extremists such as Ansar al-Shariah with
al-Qaida’s international network. The only intelligence connecting al-Qaida to the attack was an
intercepted phone call that night from a participant in the first wave to a friend in another
African country with ties to al-Qaida members, officials briefed on the call said. But when the
friend heard the attacker’s boasts, he sounded astonished, the officials said, suggesting he had no
prior knowledge of the assault.

Al-Qaida was having its own problems penetrating the chaos in Libya. Three weeks after the
attack, on Oct. 3, 2012, leaders of its regional affiliate, al-Qaida in the Islamic Maghreb, wrote
to a lieutenant about efforts to crack the new territory. The leaders said they had sent four teams
to seek footholds in Libya. But only two in the southern Sahara “were able to enter Libyan
territory and lay the first practical bricks there,” the letter said.

The letter, left behind when the group’s leaders fled French troops in Mali, was later obtained
and released by the Associated Press.

In the days after the Benghazi attack, meanwhile, Abu Khattala was still at work on construction
sites and moving at ease around the city, even mocking the U.S. political debate about the
ambassador’s death. “It is always the same two teams, but all that changes is the ball,” he said in
an interview. “They are just laughing at their own people.”

He suggested that the video insulting the Prophet Muhammad might well have justified the killing
of four Americans. “From a religious point of view, it is hard to say whether it is good or bad,”
he said.

By summer, U.S. investigators had interviewed hundreds of witnesses and formally asked the
Libyan government to arrest Abu Khattala, along with about a dozen others wanted for questioning.
The U.S. military also prepared a plan to capture him on its own, officials said. But the
administration held back, fearing that unilateral U.S. military action could set off a backlash
that would undermine the fragile Libyan government.

Hearing rumors that a revenge-seeking mob was threatening to come after Abu Khattala this fall,
dozens of his neighbors sprang to his defense. Fighters raced to erect checkpoints near his house,
and they pulled out AK-47s, grenade launchers, truck-mounted artillery and even a tank.

Al-Gharabi said Libya’s prime minister, under U.S. pressure, had asked a Benghazi army commander
for help apprehending Abu Khattala.

Al-Gharabi quoted the commander as replying, “You will be lucky if he does not apprehend
you."