(Sarah Parnass/The Washington Post)

British investigators searching for clues to the motives and possible accomplices of the suicide bomber who killed at least 22 at a concert in Manchester are increasingly focusing on Libya — and the Islamic State’s presence here.

Authorities say that Salman Abedi, a British citizen of Libyan descent, spent four weeks in Libya, returning to Manchester days before he carried out Monday night’s attack, for which the Islamic State asserted responsibility. His brother, Hashem Abedi, was arrested in the capital, Tripoli, on Tuesday on suspicion of having ties to the group, and authorities say he was planning an attack in this Mediterranean city.

The focus on Libya comes as the Islamic State branch here has fragmented into smaller groups, spreading across the nation and into neighboring nations.

Investigators are trying to find out whether a network of plotters extended all the way to Libya. Did anyone help Salman Abedi build the bomb, and did he receive other assistance from Islamic State cells or operatives in Libya?

But pursuing leads in this fractured North African nation is rife with obstacles. Rival militias control different regions, even enclaves within the capital, as a civil war spreads economic and political instability across the country. Three governments are competing for authority — the one recognized by Western powers and the United Nations wields no influence in the east. Even government bodies, including those dealing with law enforcement, are plagued by competing factions.

For instance, Hashem Abedi, as well as the brothers’ father, Ramadan Abedi, were arrested by a counterterrorism militia affiliated with the U.N.-backed Government of National Accord. But human rights groups have accused the force of abusing prisoners, potentially raising questions about suspects’ confessions.

Meanwhile, security services in Manchester carried out raids Thursday and arrested two male suspects, bringing to eight the number in British custody who are suspected of involvement in the attack.

A German security official told The Washington Post that Salman Abedi, 22, had transited through Düsseldorf just four days before the bombing. The development signaled an expansion of the investigation.

But after six years of civil conflict and a revolving door of political and military players, it is also unclear whether Britain and its Western allies have reliable contacts and sources to help with the probe in Libya. Every Western embassy in Tripoli has been closed for at least two years, except for Italy’s, which reopened only this year.

Several other extremist groups also operate in Libya, among them al-Qaeda in the Islamic Maghreb, the terror network’s North Africa branch. All have skilled bombmakers and experts in weapons and militant training.

The Islamic State itself is in flux. If anything, the carnage in Manchester underscores the lingering potency of the group in Libya, despite recent setbacks to its operations and its ambitions — provided its suspected links to the brothers prove to be true.

“They used to be in Sirte, and so we knew their location,” said Badra Gaaloul, a military analyst who heads the Tunisia-based International Center of Strategic, Security and Military Studies, referring to the Islamic State’s former Libyan stronghold.

“Now they are everywhere, and it’s incredibly hard to detect them and target them,” she said.

The Islamic State, also known as ISIS or ISIL, emerged in Libya after the 2011 revolution, part of the Arab Spring uprisings, when NATO airstrikes helped oust dictator Moammar Gaddafi, who was subsequently killed by rebels. Seizing advantage of the instability, tribal rivalries and an abundance of weapons in the country, the Islamic State in Libya became the group’s strongest branch outside the Middle East.

In early 2015, its fighters entered Sirte, a coastal city that is Gaddafi’s birthplace and where he was killed. By the summer, the group controlled Sirte, nestled in the country’s lucrative petroleum crescent, the heart of much of its oil and gas reserves.

In Sirte, the Islamic State ruled through fear and brutality, mirroring the group’s counterparts in Syria and Iraq. But it also sought to create a government, an effort to extend its self-proclaimed caliphate into Libya. Under pressure in the Middle East, the group saw Sirte as a possible substitute capital, particularly if its Syrian haven of Raqqa fell.

But last summer, pro-government militias laid siege to Sirte. Backed by U.S. airstrikes, they drove the Islamic State out of Sirte. While many militants died, hundreds of others escaped from the city, according to security officials and military analysts.

Today, the Islamic State is diminished in size but remains a major concern.

In March, Marine Corps Gen. Thomas Waldhauser, head of the Pentagon’s Africa Command, told the Senate Armed Services Committee that instability in Libya and North Africa “may be the most significant near-term threat” to the interests of the United States and its allies in Africa.

He said that while the Islamic State has left Sirte, its fighters are gathered “in small numbers and are regrouping.” The Islamic State in Libya, he added, “remains a regional threat with intent to target U.S. persons and interests.”

According to U.S. military and intelligence officials and regional analysts, many Islamic State militants have fled to southern Libya and are believed to be regrouping there.

Others have crossed the southern border into Niger, perhaps heading to Nigeria, Mali or Chad to join other militant groups aligned with the Islamic State, such as northern Nigeria’s Boko Haram, said Claudia Gazzini, a senior Libya analyst for the International Crisis Group.

“My sense is that they are transiting through the south and going out,” said Gazzini, who recently visited southern Libya.

Other fighters have crossed into Tunisia or have joined al-Qaeda and other militant groups, said Gaaloul, the military analyst in Tunisia. The Islamic State in Libya, she said, is more dangerous than ever because many fighters have scattered and are moving under the radar in Tripoli and other parts of the country.

“Now, I don’t know who is an ISIS fighter,” Gaaloul said. “They have strength and power in hiding themselves. They can pose as civilians. And [ISIS leader] Abu Bakr al-Baghdadi has given them the freedom to become lone wolves. He’s told them, ‘If you have the opportunity to attack our enemies, do it.’ ”

Read more: