Fayez Serraj, center, head of the U.N.-backed unity government meets with his team in Tripoli, Libya, on March 31. (Mohamed Ben Khalifa/AP)

The shaky debut last week of a new unity government in Libya brings Western nations, including the United States, much closer to a renewed military mission there, and to a host of obstacles that will test their ability to secure a country gripped by Islamist extremism and civil war.

Tensions ran high on Wednesday after Fayez Serraj, a little-known Libyan technocrat selected as prime minister in a United Nations peace process, arrived by boat in Tripoli from Tunisia. Western officials hailed his installation in the Libyan capital as a sign that the country’s two-year political divide is finally coming to an end — despite the existence of rival governments in Tripoli and the country’s east.

The United States and European allies, including Italy, France and Britain, have made the unity government’s establishment a key precondition for launching twin missions to begin an international stabilization effort and help combat a growing Islamic State affiliate there.

Each of those tasks will be strained by tensions among militia factions that Western nations hope will form a unified front against terrorist groups and by strong reluctance among European nations to wade into Libya’s chaos — even among those countries most threatened by the Islamic State’s growth across the Mediterranean.

[In Libya, the Islamic State’s black banner rises by the Mediterranean]

Pro-UN-backed government protesters hold placards and shout slogans during a demonstration in the Libyan capital Tripoli on April 1. (Mahmud Turkia/AFP/Getty Images)

The tentative political progress comes as the United States moves forward with plans to launch intensified attacks against the Islamic State’s Libyan branch, which has up to 8,000 fighters and is the group’s strongest affiliate outside Iraq and Syria.

Planners at the U.S. Africa Command are now developing dozens of targets across Libya that American or European warplanes might strike. They range from the coastal city of Sirte, where the extremist group has established a refuge, to Ajdabiya, Sabratha and the militant stronghold of Derna. U.S. jets have carried out strikes against the group there twice since last fall.

The Pentagon is also seeking to improve coordination between U.S. Special Operations forces and their French and British counterparts, which have established small cells on the ground, seeking in part to line up friendly militias that can take on the extremist fighters.

Ben Fishman, who was a White House official responsible for Libya earlier in the Obama administration, said the U.S. campaign against the Islamic State in Libya is likely to be much more modest in scope than ongoing U.S. and allied operations in Iraq and Syria.

“The wild card is, of course, if there are connections between Libya and terror threats in Europe,” he said.

Officials at the U.S. Africa Command will also have to contend with the challenges of launching an operation in a region that lacks the same military infrastructure the United States has elsewhere in the Middle East.

U.S. officials continue to seek permission from neighboring countries to launch U.S. flights, which would allow American planes more watch time on surveillance or strike missions. So far, Tunisia and Algeria have declined, meaning that manned and unmanned missions would probably be launched from military installations in Italy, Spain or Greece, or from as far away as Britain.

The prospect of another Western intervention in Libya has divided North Africa. Tunisia is facing increased terrorist threats and is reluctant to attract new attacks. Algeria is categorically opposed to outside involvement. And Egypt is already backing the eastern faction in Libya’s civil war.

But the biggest challenge will probably be divisions among Libya’s myriad armed factions, including militias formed during the 2011 revolution and remnants of former dictator Moammar Gaddafi’s army. Washington hopes to build a coherent force from among those groups to take on the Islamic State, also known as ISIS.

According to one Libyan official, who, like others, spoke on the condition of anonymity to discuss planning, the United States may try to muster forces to attack the Islamic State stronghold in Sirte from Misurata, a prosperous city just to the west, and from Ajdabiya, where local militia leader Ibrahim Jathran commands a significant oil-

protection force.

But analysts warn that ad hoc Western outreach to individual militia groups, many of which have fought one another repeatedly since 2011, could actually intensify factional violence and reduce the odds of national reconciliation.

“I would caution [against] international intervention of this nature, in this form and at this time, without having a coherent plan for these groups to work together,” said Anas El Gomati, director of the Sadeq Institute, a Libyan think tank. “If they are all fighting one another, how are they going to fight ISIS?”

U.S. officials envision a gradual absorption of militia forces into a new national army or at least a network of state-backed regional or tribal forces.

After months of talks, the United States and European and Arab nations have yet to make concrete military commitments to what is known as the Libya International Assistance Mission, potentially undermining the nascent government, which needs to establish its legitimacy and impose order.

Italy has promised to provide at least half of the resources for that effort, which could bring thousands of Italian or other European troops to Tripoli to advise local forces on securing the capital.

But, in a reflection of European nations’ reluctance to get pulled into a risky overseas campaign, Rome has also laid out a series of conditions for sending troops, including a U.N. Security Council resolution and — most problematic — adequate security in Tripoli before Italian troops will be deployed.

Karim Mezran, a Libya scholar at the Atlantic Council, said the Italian-led talks have not yet produced a coherent plan to help Serraj’s would-be administration confront its militant foes.

“It leads us to ask the question I’ve been asking from the beginning: Who’s going to provide the new government the support it requires on the ground?”

U.S. and European officials say their cautious approach will give the new government time to determine and request the right outside help. But they also acknowledge there will be a limited window for helping the Serraj government prove its legitimacy.

Western plans don’t yet appear to take into account the widespread radicalization that has made Libya a hotbed for Islamist groups since 2011.

Defense Secretary Ashton B. Carter recently suggested that Libyans, once unified under a new government, will rise up to expel a largely foreign force. Libyans “don’t like foreigners who come into their territory. That’s what ISIL is,” he said, using another acronym for the Islamic State.

While fighters from North Africa and other nations have flocked to join the group’s ranks in Libya, U.S. intelligence officials believe the majority of fighters are Libyan.

Local supporters include marginalized tribesmen, loyalists to the Gaddafi regime and youths from some of the many extremist groups that have flourished in Libya since 2011. In western Libya, smugglers and criminal gangs have also fueled the Islamic State’s rise.

Claudia Gazzini, senior Libya analyst for the International Crisis Group, said the Islamic State retains some appeal among Libyans, many of whom see the group as a lesser evil compared with militias and other rival factions.

“In the situation Libya is in at the moment, where you have military factions engaging in ­localized wars, it’s very much a case of survival,” she said.

Raghavan reported from Cairo. Souad Mekhennet in Tunis contributed to this report.

Read more: