CAIRO (AP) -- For many Libyans, clashes that erupted in the capital of Tripoli last month were all too familiar -- a deja vu of street fighting, reverberating gunfire and people cowering inside their homes. A video circulated online on the day, showing a man shouting from a mosque loudspeaker "Enough war, we want our young generation!"
The fighting underscored the fragility of Libya's relative peace that has prevailed for more than a year but it also looked like history was repeating itself. Now, observers say that momentum to reunify the country has been lost and that its future is looking grim.
Once again, there are two competing governments vying for control in Libya, already torn by more than a decade of civil war. The clashes in the capital broke out after one of Libya's two prime ministers challenged the other by coming to Tripoli, his rival's seat.
Libya has for years been split between rival administrations in the east and the west, each supported by rogue militias and foreign governments. The Mediterranean nation has been in a state of upheaval since the 2011 NATO-backed uprising toppled and later killed longtime dictator Moammar Gadhafi.
But a plan had emerged in the past two years that was meant to put the country on the path toward elections. A U.N.-brokered process installed an interim government in early 2021 to shepherd Libyans to elections that were due late last year.
That government, led by Prime Minister Abdul Hamid Dbeibah, briefly unified the political factions under heavy international pressure. But the voting never took place, and since then, the plan has unraveled and left the country in crisis.
Lawmakers in Libya's east-based parliament, headed by influential speaker Aguila Saleh, argued that Dbeibah's mandate ended when the interim government failed to hold elections.
They went ahead and chose Fathi Bashagha, a powerful former interior minister from the western city of Misrata, as new prime minister. Their position gained the endorsement of powerful commander Khalifa Hifter whose forces control the country's east and most of the south, including major oil facilities.
Dbeibah has refused to step down, and factions allied with him in western Libya deeply oppose Hifter. They maintain that Dbeibah, who is also from Misrata with ties to its powerful militias, is working toward holding elections.
Analysts are skeptical.
Claudia Gazzini, a Libya expert at the International Crisis Group, described the Bashagha-Dbeibah rivalry as "a feud over legitimacy," with "both governments claiming they are legitimate."
"I don't think they will be able to hold elections this year," she said, and also expressed doubts that U.N. attempts to get Libyan parties to reach a constitutional consensus on the elections will make any progress.
The power struggle came to a head on May 17, when Bashagha entered Tripoli and attempted to install his government there. He had help from the powerful Nawasi Brigade militia, led by Mustafa Qaddur, deputy head of Libya's intelligence agency.
But Bashagha faced stiff resistance from militias loyal to Dbeibah, leading to hourslong clashes that rocked the city until Bashagha withdrew and a day later set up his government headquarters in the coastal city of Sirte, half way between Libya's power centers in the east and the west.
The withdrawal emboldened Dbeibah, who promptly sacked Qaddur and another military official, Osama Juwaili, who heads the military intelligence agency. The dismissal of Qaddur was subsequently reversed by the presidential council -- an apparent crack within Dbeibah's camp.
According to an official close to Dbeibah, the Tripoli-based prime minister is convinced Bashagha could not have entered the Libyan capital without "approval or coordination" with Juwaili, a powerful figure from the western city of Zintan, and also Qaddur.
Juwaili's forces, the official said, manned checkpoints and control areas near Gharyan, a town south of Tripoli, where Bashagha's convoy passed on its way to the capital. The official spoke to The Associated Press on condition of anonymity to discuss intelligence details.
Even after Bashagha's withdrawal, tensions remain high in Tripoli.
Some, like Libya researcher Jalel Harchaoui, believe Bashagha could make another move on Tripoli -- or at least attempt to galvanize more support in the area.
"Given the scars that are now out in the open, such a scenario" is entirely possible, he said.
Meanwhile, Libya's prized light crude is again being used as a tool in the power struggle. Tribal leaders have shut down crucial oil facilities, including the country's largest oil field in the south controlled by fighters loyal to Hifter, who supports Bashagha.
The oil blockade -- which comes as oil prices are skyrocketing because of the war in Ukraine -- was likely meant to deprive Debeibah's government of funds and empower his rival. Bashagha and Saleh have said the facilities would be reopened on condition that oil revenues be temporarily frozen until rival factions agree on a mechanism to distribute oil funds.
The war in Ukraine has distracted the international community but its ripples have been felt in Libya, where Russia has long played an outsized role.
Russia has recognized Bashagha's government, which Gazzini of the International Crisis Group says makes it difficult for Western countries to also do -- so as not to be seen as being on the same side as Russia.
For ordinary Libyans, last month's deadly violence -- one person was killed in the fighting -- was a stark reminder of how fragile the relative peace had been.
"Chaos and conflict are their feeding ground," said Mohammed Abu Salim, in his 30s and a civil servant from Tripoli, referring to Libya's rival factions.
"If you really believe that those people will allow free and fair elections, then you are delusional."