As Libya has descended into chaos, it has split into two broad camps. On one side is Libya Dawn, an Islamist-backed umbrella group; on the other is a renegade general, Khalifa Hifter, who is based in the eastern part of the country along with his allies.
As this power struggle has escalated, it is no longer just an internal Libyan conflict. It is now being fought regionally, with parallels to other battles playing out in North Africa and the Middle East.
U.S. officials say Egypt and the United Arab Emirates carried out secret airstrikes in recent days directed against the Islamist factions, which was first reported in The New York Times. This direct involvement in the Libyan fighting came as a surprise, though both of these countries have staked out positions opposing Islamist groups in their own countries and abroad.
"We see in the battle that is being fought out in Libya between these two broad coalitions is a battle that is already being fought out regionally," says Claudia Gazzini, a Libya researcher at the International Crisis Group.
But outsiders picking sides may just make things worse in Libya, Gazzini notes.
"There is a risk that regional actors step in on one side or the other, and this could complicate a solution to Libya's problems," says Gazzini. "An imploded Libya will have security implications for its neighbors.
The newly appointed United Nations envoy to Libya, Bernardino Leon, has warned against foreign intervention. And U.S. officials quoted in The New York Times said the airstrikes were not constructive.
Egypt has denied it was involved, and the UAE has not publicly commented.
In Cairo, Libya's newly appointed military chief of staff said in a press conference that Egypt has promised to provide military support to Libya's military.
"We lack a little support, which Egypt's President Abdel-Fattah el-Sissi has promised to give us," said Abdel Razzak Nadhuri, who was appointed by Libya's new parliament. He called Libya's battle a fight against extremists.
Sissi, the former head of Egypt's military, was behind the 2013 coup and the sweeping crackdown against the Muslim Brotherhood, the Islamist group that was elected in 2012.
In the same press conference in Cairo, Egypt's foreign minister said his country was not involved militarily in Libya. But he did say that Egypt supported "legitimate bodies" in Libya.
But what are legitimate bodies in Libya?
Right now, there are two parliaments. A newly elected body has convened in the eastern city of Tobruk, a stronghold for Hifter's anti-Islamist forces that's about 1,000 miles east of Tripoli.
Meanwhile, the old parliament reconvened in Tripoli, which is now controlled by Libya Dawn after weeks of fighting that destroyed Tripoli's airport. Even though they're the outgoing parliament, they appointed a new prime minister and are being backed by Libya Dawn.
Libya Dawn calls the new parliament and its allies counter-revolutionaries who are trying to hijack Libya and bring back the old regime that existed under dictator Moammar Gadhafi.
Meanwhile, Hifter's forces and the newly elected parliament call Libya Dawn terrorists and extremists who threaten Libya.
No one is in the mood to compromise.
"At the moment we're seeing the violence localized to Tripoli and the surrounding area and the far east, so violence has not spilled over into the rest of Libya," says Gazzini of the International Crisis Group.
The country is plagued with militias and a weak central government, and now armed groups are joining one side or the other in this polarized fight. Neighboring countries are alarmed that Libya's fighting will spill over the borders.
A solution must come from within Libya, Gazzini says, but the international community could help by not sending additional weapons. The weapons may be intended to stabilize a government, but they end up with the militias, she says.
NPR Cairo correspondent Leila Fadel has reported extensively from Libya. Follow her @LeilaFadel.