It was a grisly start to the new era for Libya, broadcast around the world. The dictator was dragged from the sewer pipe where he was hiding, tossed around by frenzied rebel soldiers, beaten bloody and sodomized with a bayonet. A shaky cellphone video showed the pocked face of Col. Muammar el-Qaddafi, “the Leader” who had terrified Libyans for four decades, looking frightened and bewildered. He would soon be dead.

The first news reports of Colonel Qaddafi’s capture and killing in October 2011 reached the secretary of state in Kabul, Afghanistan, where she had just sat down for a televised interview. “Wow!” she said, looking at an aide’s BlackBerry before cautiously noting that the report had not yet been confirmed. But Hillary Clinton seemed impatient for a conclusion to the multinational military intervention she had done so much to organize, and in a rare unguarded moment, she dropped her reserve.

“We came, we saw, he died!” she exclaimed.

Two days before, Mrs. Clinton had taken a triumphal tour of the Libyan capital, Tripoli, and for weeks top aides had been circulating a “ticktock” that described her starring role in the events that had led to this moment. The timeline, her top policy aide, Jake Sullivan, wrote, demonstrated Mrs. Clinton’s “leadership/ownership/stewardship of this country’s Libya policy from start to finish.” The memo’s language put her at the center of everything: “HRC announces … HRC directs … HRC travels … HRC engages,” it read.

The Libya Gamble

An examination of the American intervention in Libya and Hillary Clinton’s role in it.

It was a brag sheet for a cabinet member eyeing a presidential race, and the Clinton team’s eagerness to claim credit for her prompted eye-rolling at the White House and the Pentagon. Some joked that to hear her aides tell it, she had practically called in the airstrikes herself.

In fact, on the same August day that Mr. Sullivan had compiled his laudatory memo, the State Department’s top Middle East hand, Jeffrey D. Feltman, had sent a lengthy email with an utterly different tone about what he had seen on his own visit to Libya.

The country’s interim leaders seemed shockingly disengaged, he wrote. Mahmoud Jibril, the acting prime minister, who had helped persuade Mrs. Clinton to back the opposition, was commuting from Qatar, making only “cameo” appearances. A leading rebel general had been assassinated, underscoring the hazard of “revenge killings.” Islamists were moving aggressively to seize power, and members of the anti-Qaddafi coalition, notably Qatar, were financing them.

On a task of the utmost urgency, disarming the militia fighters who had dethroned the dictator but now threatened the nation’s unity, Mr. Feltman reported an alarming lassitude. Mr. Jibril and his associates, he wrote, “tried to avert their eyes” from the problem that militias could pose on “the Day After.”

Where the Islamic State Is Active in Libya

Last year, ISIS carried out dozens of attacks in Libya, just 300 miles from Europe.

Episodes of violence by ISIS or its affiliates in 2015

ISIS controls more than 150 miles of coastline around Surt

Tripoli

Darnah

Misurata

Bayda

Tobruk

Benghazi

Surt

Abugrein

Bin Jawad

Ajdabiya

Nawfaliya

Area of detail

libya

LIBYA

100 MILES

Episodes of violence by

ISIS or its affiliates in 2015

ISIS controls more than 150 miles of coastline around Surt

Misurata

Surt

Abugrein

Bin Jawad

Nawfaliya

Area of detail

LIBYA

libya

50 MILES

Episodes of violence by ISIS or its affiliates in 2015

ISIS controls more than 150 miles of coastline around Surt

Tripoli

Darnah

Misurata

Bayda

Tobruk

Benghazi

Surt

Abugrein

Bin Jawad

Ajdabiya

Nawfaliya

Area of detail

LIBYA

libya

100 MILES

Source: Data on episodes of violence compiled by the Armed Conflict Location and Event Data Project based on news reports

JAN. 18, 2016

By The New York Times

In short, the well-intentioned men who now nominally ran Libya were relying on “luck, tribal discipline and the ‘gentle character’ of the Libyan people” for a peaceful future. “We will continue to push on this,” he wrote.

In the ensuing months, Mr. Feltman’s memo would prove hauntingly prescient. But Libya’s Western allies, preoccupied by domestic politics and the crisis in Syria, would soon relegate the country to the back burner.

And Mrs. Clinton would be mostly a bystander as the country dissolved into chaos, leading to a civil war that would destabilize the region, fueling the refugee crisis in Europe and allowing the Islamic State to establish a Libyan haven that the United States is now desperately trying to contain.

“Nobody will say it’s too late. No one wants to say it,” said Mahmud Shammam, who served as chief spokesman for the interim government. “But I’m afraid there is very little time left for Libya.”

Secretary of State Hillary Clinton met a wounded soldier loyal to the transitional government at a hospital in Tripoli during a visit to Libya on Oct. 18, 2011.Credit
Pool photo by Kevin Lamarque

‘WHAT ELSE CAN YOU DO?’

Media reports referred to Mrs. Clinton’s one brief visit to Libya in October 2011 as a “victory lap,” but the declaration was decidedly premature. Security precautions were extraordinary, with ships positioned off the coast in case an emergency evacuation was needed. As it turned out, there was no violence. But the wild celebratory scenes in the Libyan capital that day actually highlighted the divisions in the new order.

At a hospital, a university and government offices, Mrs. Clinton posed for photos with the Western-educated interim leaders and hailed the promise of democracy.

“I am proud to stand here on the soil of a free Libya,” she declared, standing alongside a beaming Mr. Jibril. “It is a great privilege to see a new future for Libya being born. And indeed, the work ahead is quite challenging, but the Libyan people have demonstrated the resolve and resilience necessary to achieve their goals.”

But everywhere Mrs. Clinton went, there was the other face of the rebellion. Crowds of Kalashnikov-toting fighters — the thuwar, or revolutionaries, as they called themselves — mobbed her motorcade and pushed to glimpse the American celebrity. Mostly they cheered, and Mrs. Clinton remained poised and unrattled, but her security detail watched the pandemonium with white-knuckled concern.

Video

Hillary Clinton’s Legacy in Libya

As the secretary of state in 2011, Hillary Clinton pressed the Obama administration to intervene militarily in Libya, with consequences that have gone far beyond the fall of Col. Muammar el-Qaddafi.

By AINARA TIEFENTHÄLER on Publish Date February 27, 2016.
Photo by Alex Wong/Getty Images.
Watch in Times Video »

At the University of Tripoli, students were trampling wall hangings of Colonel Qaddafi that had been pulled to the ground, recalled Harold Koh, the State Department’s top lawyer, who had flown in with Mrs. Clinton on an American military aircraft. One grateful student pointed out the gallows where anti-Qaddafi protesters had been hanged, while others wondered what the United States might do to help win the peace.

“We know what the U.S. can do with bombs,” one student told Mr. Koh. “What else can you do?”

When Mrs. Clinton’s entourage finally departed, Gene A. Cretz, the American ambassador, wrote a relieved email to Cheryl Mills, the secretary of state’s chief of staff. The visit, he wrote, had been “picture perfect given the chaos we labor under in Libya.”

Mrs. Clinton certainly understood how hard the transition to a post-Qaddafi Libya would be. In February, before the allied bombing began, she noted that political change in Egypt had proved tumultuous despite strong institutions.

"So imagine how difficult it will be in a country like Libya,” she had said. “Qaddafi ruled for 42 years by basically destroying all institutions and never even creating an army, so that it could not be used against him.”

Early on, the president’s national security adviser, Tom Donilon, had created a planning group called “Post-Q.” Mrs. Clinton helped organize the Libya Contact Group, a powerhouse collection of countries that had pledged to work for a stable and prosperous future. By early 2012, she had flown to a dozen international meetings on Libya, part of a grueling schedule of official travel in which she kept competitive track of miles traveled and countries visited.

Dennis B. Ross, a veteran Middle East expert at the National Security Council, had argued unsuccessfully for an outside peacekeeping force. But with oil beginning to flow again from Libyan wells, he was pleasantly surprised by how things seemed to be going.

“I had unease that there wasn’t more being done more quickly to create cohesive security forces,” Mr. Ross said. “But the last six months of 2011, there was a fair amount of optimism.”

Even so, the gulf separating the suave English speakers of the interim government from the thuwar was becoming more and more pronounced.

After decades in exile, some leaders were more familiar with American and European universities than with Libyan tribes and the militias that had sprung from them. Others, like Mr. Jibril, were suspect in some quarters because of previous roles in the Qaddafi regime. It was increasingly evident that the ragtag populist army that had actually done the fighting against Colonel Qaddafi was not taking orders from the men in suits who believed they were Libya’s new leaders.

“It should have been clear to anyone,” said Mohammed Ali Abdallah, an opposition member who now heads a leading political party, “that there were clear contradictions in the makeup of the opposition and that unity could not last.”

Jeremy Shapiro, who handled Libya on Mrs. Clinton’s policy staff, said the administration was looking for “the unifier — the Nelson Mandela.” He added: “That was why Jibril was so attractive. We were always saying, ‘This is the guy who can appeal to all the factions.’ What we should have been looking for — but we were never good at playing that game — is a power balance.”

Under the circumstances, Libya’s push for elections by July 2012, nine months after Colonel Qaddafi’s death, appeared to some to be premature. But the schedule fulfilled the opposition’s promises to the West and had the backing of competing factions.

“Suddenly you had people who belonged to political parties,” said Abdurrazag Mukhtar, a member of the interim government who lived in California for many years and is now Libya’s ambassador to Turkey. “The Muslim Brotherhood. Jibril. All these guys thinking, ‘Time for an election.’”

“But we were not ready,” he said. “You needed a road map for security first.”

Abdurrahim el-Keib, the interim prime minister, seated in center, met representatives of the Toubou ethnic group in April 2012. By then, Mrs. Clinton had received “worrying” reports about what was happening in Libya.Credit
Anis Mili/Reuters

‘FIERCE LIMITS’

By January 2012, there was an unmistakable drumbeat of trouble.

His popularity sagging, Mr. Jibril had stepped down as transitional prime minister. A prominent Muslim scholar had accused him of guiding the nation toward a “new era of tyranny and dictatorship.” In a deal struck between two powerful militias, he was replaced by Abdurrahim el-Keib, an engineering professor who had taught for years at the University of Alabama.

On Jan. 5, Mrs. Clinton’s old friend and adviser Sidney Blumenthal emailed her with the latest in a series of behind-the-scenes reports on Libya, largely written by a retired C.I.A. officer, Tyler Drumheller, who died last year.

The memo detailed the roiling tensions between Islamists and secularists over the role of Islamic law, fighting between rival militias associated with two different towns and four visits to Mr. Keib’s office by “angry militiamen” demanding concessions.

Mr. Keib, the email said, “believes that if he does not disarm the militias and meet their demands in the next six months, there is a good chance of increased fighting among rival groups that could lead to civil war.” Mrs. Clinton forwarded the message to Mr. Sullivan, her policy aide, with a single comment: “Worrying.”

Such alarming reports might have been expected to spur action in Washington. They did not.

After Colonel Qaddafi’s fall, with minimal violence and friendly interim leadership, Libya had moved quickly off the top of the administration’s agenda. The regular situation room meetings on Libya, often including the president, simply stopped. The revolt in Syria, in the heart of the Middle East and with nearly four times Libya’s population, took center stage.

“The president was like, ‘We are not looking to do another Iraq,’” said Derek Chollet, then handling Libya for the National Security Council. “And by the way, the Europeans were all along saying: ‘No, no, no, we’re doing this. We got it. We believe in Libya. This is in our neighborhood.’”

So the president and the National Security Council set what one official called “fierce limits” on the American role: The United States would provide help only when it could offer a unique capability, only when Libya explicitly requested the services and only when Libya paid for them with its oil revenue. In practice, those conditions meant the United States would do very little.

And though the French president, Nicolas Sarkozy, and the British prime minister, David Cameron, visited Libya together, they, too, were soon distracted, by re-election campaigns and economic worries.

The neglect was made easier by the Libyans themselves. Displaying both naïveté and nationalism, the interim leaders insisted, at least in public, that they wanted no outside interference. They were so wary of foreign troops that they refused to let the United Nations maintain a basic security force to protect its compound.

“They were very keen to take responsibility for their country,” Mr. Shapiro said. “And we were very keen to let them, for our own reasons. So there was a sort of conspiracy there.”

As the months passed and the factional fighting grew worse, Mrs. Clinton pressed for the administration to do more, asking the Pentagon, for example, to help train security forces. But she was boxed in by the president’s strictures and the Libyans’ resistance.

“It’s like you’re twisting yourself into a pretzel to try to say, ‘O.K., we won’t have boots on the ground, but we know we got to do something,’” Mr. Ross said.

Even modest proposals foundered. When Mrs. Clinton proposed sending a hospital ship to treat wounded Libyan fighters, the National Security Council rejected the idea, aides said.

A depot in Benghazi where arms and ordnance were collected by anti-Qaddafi forces. American efforts to secure the vast arsenal left by Col. Muammar el-Qaddafi largely failed.Credit
Tyler Hicks/The New York Times

‘LOST FROM THE BEGINNING’

Andrew Shapiro was trying to make the best of a bad situation. He had to explain what the United States was doing to secure the vast military arsenal that Colonel Qaddafi had left behind — a notable exception to the hands-off policy.

Speaking in Washington in February 2012, Mr. Shapiro, the assistant secretary of state for political-military affairs, described efforts to “galvanize an international response” to find and destroy arms caches. But he acknowledged that the $40 million program Mrs. Clinton had announced was not going as well as hoped, even when it came to the most worrisome weapons, the Manpads, shoulder-fired missiles capable of shooting down an airliner.

“How many are still missing? The frank answer is we don’t know and probably never will,” Mr. Shapiro said. “We cannot rule out that some weapons may have leaked out of Libya.”

The covert coals-to-Newcastle effort to arm the rebels during the revolution was the least of it. The dictator had stashed an astonishing quantity of weapons in the desert.

“We knew he had a lot, but he had 10 times that,” said Jean-David Levitte, then a top aide to Mr. Sarkozy.

While the C.I.A. moved quickly to secure Colonel Qaddafi’s chemical weapons, other efforts fell short. “There was one arsenal that we thought had 20,000 shoulder-fired, surface-to-air missiles, SA-7s, that basically just disappeared into the maw of the Middle East and North Africa,” recalled Robert M. Gates, the American defense secretary at the time.

A major stumbling block was that the Obama administration was negotiating with interim Libyan ministers as if they represented a unified government. In fact, they were often rivals, jockeying for power in advance of the elections.

“I know this sounds incredible, but for months and months and months on end we could not get anyone in authority in the government to just sign an agreement on anything, including our detailed offers of security assistance,” said Antony J. Blinken, then the top security aide to Vice President Joseph R. Biden Jr. “There was total paralysis.”

When it came to securing weapons, the Americans’ initial idea — to give the interim government assistance to buy them back itself — foundered when the Libyan ministers failed to carry out the program, several Libyan officials said.

So the State Department, working with the C.I.A., was left to try to strike its own deals with the militias. But there was little incentive to sell. As Mr. Shammam, the former spokesman for the interim government, put it: “How are you going to buy a Kalashnikov for $1,000? With a Kalashnikov, someone can make $1,000 a day kidnapping people.”

Where Weapons From Libya Have Been Found

Weapons have been trafficked out of Libya since 2011, especially through the country’s remote areas in the south. Many have turned up in regional conflict areas as far as Mali and Syria.

TURKEY

SYRIA

LEBANON

TUNISIA

GAZA

LIBYA

ALGERIA

EGYPT

SAHARA

DESERT

MALI

SUDAN

NIGER

CHAD

NIGERIA

TURKEY

SYRIA

LEBANON

TUNISIA

GAZA

LIBYA

ALGERIA

EGYPT

SAHARA

DESERT

MALI

SUDAN

NIGER

CHAD

NIGERIA

SYRIA

TUNISIA

GAZA

ALGERIA

LIBYA

EGYPT

MALI

SUDAN

CHAD

NIGER

NIGERIA

Sources: United Nations Security Council reports; Small Arms Survey

FEB. 27, 2016

By The New York Times

Worse, the program created an incentive for militias to import weapons to sell to the Americans, said Ali Zeidan, an adviser to the interim government who would inherit the problem in November 2012 when he became prime minister.

“If you want to buy weapons, you have to control the border,” Mr. Zeidan said, adding that the failure to do that led fighters to “sell them, get more and sell them again.”

Asked by a reporter that spring why it was so difficult for the United States to “get it right” when it intervened in the Middle East, Mrs. Clinton was still holding up Libya as a model of success. “I would take issue with the premise of that question,” said Mrs. Clinton, who declined to be interviewed for these articles.

But she was well aware of the deteriorating security situation.

In a February 2012 report, Amnesty International had called Libya’s militias “out of control.” The same month, Mr. Cretz, the American ambassador, warned in an email that the July elections would take place “in the context of militia control.”

“Continuing rivalries among the militias remain dangerous from the perspective of the havoc they can wreak with their firepower,” he wrote to Mrs. Clinton’s policy adviser, Mr. Sullivan, who sent it on to her.

In Mrs. Clinton’s inner circle, the boasting about her achievements in Libya had given way to a “nagging worry that it would go south,” one senior aide said. The aide recalled being instructed jokingly by Mr. Sullivan “to make sure that didn’t happen” before the American presidential election in November.

So when Libyans went to the polls on July 7, in what international observers characterized as a fair election with high turnout and little violence, Mrs. Clinton and other advocates of the intervention were relieved. In the wake of the Arab Spring in Egypt and Tunisia, voters had chosen Islamist-led governments. But in Libya, the winning coalition consisted of Western-friendly political parties led by Mr. Jibril.

The next month, with crowds in Tripoli chanting that the “blood of the martyrs will not be wasted,” power was handed over to the newly elected General National Congress, the first peaceful transition in Libya’s history.

An error has occurred. Please try again later.

You are already subscribed to this email.

Mrs. Clinton, who one aide said privately shared the worry that the country was not ready for elections, nevertheless congratulated the Libyans on “this historic milestone.”

“Now the hard work really begins to build an effective, transparent government that unifies the country,” she said.

But unity was already impossible.

“In a sense it was lost from the beginning,” said Gérard Araud, France’s ambassador to the United States and an early advocate of the intervention. “It was the same mistake you made in Iraq. You organize elections in a country with no experience of compromise or political parties. So you have an election, and you think that everything is solved. But eventually tribal realities come back to haunt the country.”

A voter in Benghazi in July 2012 — Libya’s first election in more than 40 years. Aides said Mrs. Clinton had privately shared concerns that the country was not ready.Credit
Tomas Munita for The New York Times

‘VERY SIMPLE DREAMS’

While the Americans struggled against weapons proliferation and hoped for the best, a former rebel officer took on the problem at the core of Libya’s predicament: disbanding the volatile forces that had ousted Colonel Qaddafi and helping the fighters find a place in a peaceful new Libya. The officer, M. Mustafa El Sagezli, would never meet Mrs. Clinton. But the outcome of his lonely campaign would decide to a considerable degree Libya's place in her record as secretary of state.

As deputy commander of the February 17 Martyrs Brigade, one of the largest and most capable rebel militias, Mr. Sagezli had tried his best to look after his recruits. It was, he felt, an obligation that did not end with the revolution.

Shortly after Colonel Qaddafi was killed, Mr. Sagezli had gathered a group of fighters in Benghazi. A businessman with degrees from Utah State University and the London School of Economics, he knew the rebel militias had been organized along Libya’s deepest fault lines: tribal divisions, regional loyalties and differing stances on Islam’s proper role. Yet the country could not progress unless the militias were reintegrated into civil society and replaced by a regular army.

“Some were very simple dreams,” he said. “‘Help us get married.’ Some wanted a scholarship.”

The transitional government soon set up a Warriors Affairs Commission, headed by Mr. Sagezli. Many of the 162,000 former fighters it registered were illiterate and needed education. Some wanted to join a police force or a new army, but nearly half hoped to start small businesses.

Mr. Sagezli said he had taken a proposal to the transitional government: The Labor Ministry could help would-be businessmen, the Interior Ministry could train customs and police officers, the Defense Ministry would absorb others into a national army, and so on.

It was ambitious, but the government had plenty of money; Mrs. Clinton had worked hard to free up billions of dollars in Libyan assets that had been frozen by anti-Qaddafi sanctions. Her view, said one top aide, was that if the interim government “couldn’t rule by force, let them rule by finance.”

But instead of giving priority to demobilizing the militias, as an aide said Mrs. Clinton had hoped, the transitional regime simply began paying fighters salaries that many viewed as protection money. In one illustrative incident in May 2012, Kikla militiamen stormed the office of Mr. Keib, the interim prime minister, demanding back pay as gunfire filled the air.

A militia group that had taken part in the Libyan revolution paying its members in March 2012. The money intended to help former fighters ended up strengthening the militias.Credit
Jehad Nga for The New York Times

“Don’t give them salaries for nothing,” Mr. Sagezli recalls begging. “Giving a commander money means giving strength to the militias, more loyalty for the commander, more armaments and more corruption. They never listened.” Instead, he said, “the politicians started bribing them to buy loyalty.”

With the July elections, precedent became political imperative.

In the run-up to the vote, a powerful militia shut down roads to press its demand that its eastern Libyan region have a greater say when the incoming Parliament drafted a constitution. The authorities capitulated, leaving the writing of the constitution for a second assembly to be elected later, with more seats from the east.

That, in turn, made it harder to disarm the militias, since each faction and town knew its weapons might be needed to protect its interests in the constitutional process. That was how the game would be played.

Mr. Zeidan, who became prime minister in November 2012, financed a few of Mr. Sagezli’s programs. But he continued to pay off militia leaders. Political parties aligned themselves with various commanders, and with no army or police force to carry out their will, the elected officials became increasingly dependent on the fighters extorting them.

Haig Melkessetian, a former American intelligence operative whose company provided security for European embassies in Libya, described militia rule as “anarchy — there’s just no other word for it.”

“We had to have five or six IDs to be able to pass, depending on the street,” he said.

Assassinations and “the worst kind of vigilantism” became commonplace, said Sarah Leah Whitson, who was tracking abuses in Libya for Human Rights Watch. One militia leader told her, “The G.N.C. may have had electoral legitimacy, but we have revolutionary legitimacy.”

Mr. Sagezli said he had discussed the difficulties with United Nations representatives and with the new American ambassador, J. Christopher Stevens. “I kept asking them for support,” he recalled.

But if there was any pressure from American or European officials to stop the government payoffs, he said, “it wasn’t loud enough.”

Police officers prayed next to the body of Faraj al-Deirsy, the Benghazi police chief, at his funeral after he was assassinated November 2012.Credit
Esam Al-Fetori/Reuters

‘THEY CREATED THE MONSTERS’

The American ambassador was hearing it from both sides.

Officials from Libya’s moderate governing coalition were demanding that the United States stop the wealthy nation of Qatar from sending money and arms to militias aligned with Libya’s Islamist political bloc. The Islamists, in turn, were accusing a rival gulf power, the United Arab Emirates, of providing similar patronage to fighters aligned with their political enemies.

The shipments violated a United Nations arms embargo. But Mr. Stevens told Mr. Abdallah, the Libyan party chief, that when he raised the issue with his Qatari and Emirati counterparts, he was met either with outright denials or with protestations that the shipments had gone through blessed official channels, namely government ministers aligned with various factions.

“When I go to the U.A.E., they say, ‘I’m dealing with the minister of defense — how much more official can I get?’” Mr. Abdallah recalled the ambassador saying.

It was bad enough that Libya’s elected officials lacked the will to force militias to lay down the arms they already possessed. Now, with Libya veering toward civil war, Qatar and the United Arab Emirates — waging a broader war for influence throughout the region — were providing opposing militia commanders with back-channel resupply routes.

In Washington, though, it was the Islamists’ patrons, the Qataris, who were of paramount concern.

During the 2011 Libyan revolution, Mrs. Clinton had successfully pushed the administration to take a direct role in arming opposition groups, hoping that would persuade the Qataris to stop sending weapons to extremist rebel factions. Though that clearly had not worked, she explored a similar play as she wrangled with what to do about “the Qatar problem” in 2012, aides said.

Mrs. Clinton was already pushing for an aggressive American program to arm and train Syrian rebels trying to topple President Bashar al-Assad. What if she could secure what one top aide called a “bank shot” deal in which the United States would provide assistance to certain of Qatar’s allies in Syria in return for Qatar’s dropping its support for Islamist militias in Libya?

But Mrs. Clinton’s activist streak ran up against President Obama’s deep wariness of further entanglement in the Middle East, and she lost the debate on arming the Syrian opposition. With no carrot to offer the Qataris, she asked aides to prepare a memo on how the United States might wield a stick.

Mrs. Clinton typically relied heavily on a tiny circle of close advisers. But facing a thorny problem, she sometimes convened a larger group, 15 or more aides, in her outer office, where her long sofa sat beneath a window with a view of the Lincoln Memorial.

“She really liked to get people to think through the what-if pieces — what if we do this, what are the consequences of doing that, and exploring alternatives,” said James B. Steinberg, her deputy secretary of state.

Some advisers suggested trimming military aid to Qatar or threatening to move American military assets elsewhere in the region. But Middle East hands at the State Department pushed back, saying that pressuring the gulf monarchy would only backfire. And the Defense Department strongly objected: It had a 20-year history of close cooperation with Qatar, which hosted critical American military bases.

Protesters jumped on a car during clashes in the eastern city of Benghazi on March 16, 2012.Credit
Abdullah Doma/Agence France-Presse — Getty Images

‘THINGS COULD NOT GO RIGHT’

On Aug. 8, 2012, a month after the elections, Mr. Stevens, the American ambassador, signed off on a cable sent to Washington titled "The Guns of August,” playing on the title of a classic history of the first days of World War I. It described Benghazi as moving “from trepidation to euphoria and back as a series of violent incidents has dominated the political landscape” and warned of “a security vacuum.”

No American official knew Libya better. He would pay with his life for his determination to see Libya’s tumultuous reality up close. A month after the cable was sent, Islamist extremists attacked the United States mission in Benghazi, and Mr. Stevens was one of four Americans killed.

In the assaults on the diplomatic compound and nearby C.I.A. annex, the most worrisome trends in the country came together: the feeble central government, the breakdown of law and order, the rise of militants and the months of minimal attention from Washington. Republicans quickly seized on the episode for what would become years of inquiries, hearings and fund-raising focused on Mrs. Clinton.

Still, in her last months at the State Department, Mrs. Clinton rode a wave of popularity, bolstered by an Internet meme called “Texts From Hillary.” Its emblem was a photograph of the secretary of state gazing through dark glasses at her BlackBerry. Few knew that it had been taken aboard the military transport plane taking her to Libya in those heady days after the dictator’s fall.

If the attempt to pin blame for the Benghazi attack on Mrs. Clinton would largely fail, the notion that the Libyan intervention was among her successes had become steadily more threadbare. Libya would not conform, either as cudgel or brag, to the needs of American politics.

As she exited the State Department in February 2013, factional violence, which would break into open civil war in 2014, was on the rise. The flow of refugees paying smugglers for a hazardous trip across the Mediterranean was swelling. And the Libyan chaos would give rise to two rival governments — one backed by Egypt and the United Arab Emirates, the other by Qatar, Turkey and Sudan — providing sanctuary to extremists, soon to be joined by emissaries of the Islamic State.

The weapons that had made it so hard to stabilize Libya were turning up in Syria, Tunisia, Algeria, Mali, Niger, Chad, Nigeria, Somalia, Sudan, Egypt and Gaza, often in the hands of terrorists, insurgents or criminals.

In the fall of 2012, American intelligence agencies produced a classified assessment of the proliferation of arms from Libya. “It was like, ‘Oh, my God,’” said Michael T. Flynn, then head of the Defense Intelligence Agency. “We’ve not had that kind of proliferation of weapons since really the end of the Vietnam War.”

A cynical line would begin to circulate in Washington: In Iraq, the United States had intervened and occupied — and things had gone to hell. In Libya, the United States had intervened but not occupied — and things had gone to hell. And in Syria, the United States had neither intervened nor occupied — and things had still gone to hell.

It was a dark jest designed to shift blame from baffled American policy makers to a troubled region. But it raised a serious question about Libya: If overthrowing a hated dictator in a small and relatively rich country produced such epic troubles, was American intervention ever justified?

“It’s true that things went wrong,” said Mr. Sagezli, of the warriors commission. “But from a Libyan point of view, things could not go right. We had 42 years of Qaddafi’s rule, no infrastructure, a terrible education system, thousands of political prisoners, divisions among tribes, destruction of the army. When you have such a state, when you take out the dictator, it’s like taking the cover off the pot.”

Given that background, Ms. Whitson, who monitored Libya for Human Rights Watch, thought the United States’ failure to follow up was unforgivable.

“If you are going to carry out a military intervention to decapitate the government, you are making a commitment to the stability of that country over the long haul,” she said. “Doing nothing, as we did here? A bunch of eighth graders can agree that is not an approach that is going to work.”

The history that Mrs. Clinton often cited should have been instructive, Ms. Whitson said. “In Bosnia, yes, we intervened. But there’s been peacekeeping troops there for 20 years,” she said.

Strikingly, President Obama said in 2014 that such criticism was just, and that Libya had provided his biggest lesson in foreign policy.

He did not regret the intervention, he told Thomas L. Friedman, the New York Times columnist, because without Colonel Qaddafi’s overthrow, “Libya would have been like Syria, right? Because Qaddafi was not going to be able to contain what had been unleashed there.”

But Mr. Obama said the United States and its allies “underestimated the need to come in full force” after the dictator’s fall. The Libyan experience, he said, is “a lesson that I now apply every time I ask the question: Should we intervene militarily? Do we have an answer for the day after?”

Libya, aides say, has strongly reinforced the president’s reluctance to move more decisively in Syria. “Literally, this has given him pause about what would be required if you eliminated the Syrian state,” a top adviser said.

Mrs. Clinton, by contrast, pushed for greater American involvement early in the Syrian civil war and has repeatedly called for a no-fly zone, a move Mr. Obama has so far rejected. The lessons of the Libya experience have not tempered her more aggressive approach to international crises.

While remaining political allies, the president and his former top diplomat have taken revealing shots at each other. In a rare flash of emotion after leaving office, Mrs. Clinton derided the president’s guiding principle in foreign relations: “Don’t do stupid stuff.”

“Great nations need organizing principles, and ‘Don’t do stupid stuff’ is not an organizing principle,” she said in a 2014 interview with The Atlantic.

Armed Libyans in Benghazi this month, marking the fifth anniversary of the revolution.Credit
Esam Omran Al-Fetori/Reuters

Last fall, frustrated with calls for greater American involvement in Syria, Mr. Obama dismissed them as “half-baked” and “mumbo jumbo.” Asked whether those labels applied to Mrs. Clinton’s proposals, the president denied it, not entirely convincingly.

When asked to defend her record on Libya, Mrs. Clinton has taken a line quite the opposite of her aides’ previous insistence on her central role in the intervention. “At the end of the day, this was the president’s decision,” she told a House committee in October.

She has said the military alliance that overthrew Colonel Qaddafi represented “smart power at its best,” but called Libya “a classic case of a hard choice.” Mostly, she has insisted that history’s judgment on the intervention, and her role in it, are not yet final.

“I think it sometimes shows American impatience,” she said in 2014, “that, ‘O.K., you got rid of this dictator who destroyed institutions. Why aren’t you behaving like a mature democracy?’ That doesn’t happen overnight.”

Yet if, for Mr. Obama, the Libyan experience has underscored doubts about the United States’ power to shape outcomes in other countries, it has demonstrated for Mrs. Clinton just how crucial an American presence can be.

“We have learned the hard way when America is absent, especially from unstable places, there are consequences,” she said at a House hearing on Benghazi in October, articulating what sounded like a guiding principle. “Extremism takes root, aggressors seek to fill the vacuum, and security everywhere is threatened, including here at home.”

Read Part 1 of our examination of the American intervention in Libya and Hillary Clinton’s role in it.

Scott Shane reported from New York and Washington, and Jo Becker from Cairo; Istanbul and Ankara, Turkey; Tunis; Paris; New York; and Washington. David D. Kirkpatrick contributed reporting from Cairo. Kitty Bennett contributed research.

A version of this article appears in print on February 29, 2016, on Page A1 of the New York edition with the headline: After Revolt, a New Libya ‘With Very Little Time Left’. Order Reprints|Today's Paper|Subscribe