Asked to form a salvation government on August 25, Omar al-Hassi presented his cabinet a week later to the country's much weakened General National Congress, Libya's outgoing parliament, in Tripoli, the capital.

"We reject extremism and terrorism," said al-Hassi in a televised speech last week. "I am not with a specific group, party, operation or city but stand for a government for all Libyans."

But about 1000km away, in the eastern city of Tobruk, sits a rival parliament - the House of Representatives, headed by Prime Minister Abdullah al-Thinni - recognised by most of the international community. Libya's new parliament, dominated by self-styled secular and nationalist candidates, was formed after the heavy defeat of Islamist candidates in June elections.

It's hardly an exaggeration to say Libya has two parliaments and two governments.

- Oliver Miles, former UK ambassador to Libya

"It's hardly an exaggeration to say Libya has two parliaments and two governments," Oliver Miles, a former UK ambassador to Libya, told Al Jazeera.

The House moved to Tobruk after armed groups supportive of the General National Congress began to overrun the capital. Fighters under Libya Dawn, an umbrella of several armed groups, took control of the capital's major arteries and airport after months of fighting against rival fighters largely from the mountain stronghold Zintan, southwest of Tripoli.

But it is "absolutely wrong" to see one side as "liberals" and the other as a homogeneous group of "Islamists", said Zoheir Hamedi, a researcher at the Arab Centre for Research and Policy Studies in Doha.

In the National Congress camp, explained Hamedi, Muslim Brotherhood members stand alongside Salafists, as well as members of Libya's Amazigh (Berber) movement. In the House of Representatives camp, many figures have come together in opposition to the contentious political isolation law, which banned anyone involved with the former regime from political participation.

It is "difficult to see [Haftar] as a liberal and the other side only as Islamists that are all jihadists," he said.

Who's fighting whom?

The cleavages present in Libya's political predicament act as a microcosm of the fight between the country's myriad armed groups.

In the latest stage in fighting, forces loyal to Khalifa Haftar bombed armed groups in Benghazi dominated by Ansar al-Sharia, an Islamist militia that has gained ground towards the city's military airport over the past two weeks.

Four months ago, Haftar, a Gaddafi-era general who defected in the 1980s and moved to the US, pledged he would purge Benghazi of "terrorists" with the launch of "Operation Dignity". The move prompted heavy fighting against militias who came together under the Shura [Consultative] Council of Benghazi, another umbrella Islamist organisation formed in June.

Haftar and his self-declared Libyan National Army - backed by a loose coalition of eastern tribal groups eager for increased autonomy, former Gaddafi army soldiers, and a number of politicians in the House of Representatives - made rapid progress, gaining control of parts of Benghazi before moving toward Tripoli in the west.

Inside Story - Libya's long road to democracy

Soon, however, armed groups including Ansar al-Sharia and Libya Shield 1, a group formed of anti-Gaddafi forces that fought in 2011, slowed Haftar's progress in the east. In Tripoli, fighters under the Libya Dawn banner - which includes Libya Shield Forces, who played a leading role in the 2011 uprising against Gaddafi, and armed groups from the port city of Misrata, south-east of Tripoli - expelled Qaaqaa and Sawag fighters, Haftar allies who originate from rival Zintan, south-west of the capital.

Driven by ideology?

When Haftar moved his troops into Benghazi, he tried to frame his move as a fight against terrorism and linked his activities to the global war on terror, said Vijay Prashad, professor of International Studies at Trinity College. "His message is 'I am a Libyan', a strong message that differentiates himself from what he would consider the fissiparous tendencies of the militias," Prashad told Al Jazeera.

But Osama Kubbar, former vice-president of the Supreme Council of Revolutionaries, a coalition of armed groups, politicians and Islamists with links to Misrata,considers groups fighting against Haftar as "freedom fighters" struggling against counter-revolutionary forces. "The vast majority [of people fighting against Haftar and his allies are regular Libyans without ideology. They want pride and dignity," he said.

Haftar's operation has labelled all opponents, including moderates, as terrorists, said Anas el Gomati, head of Libya's only independent thinktank, El Sadeq. The result is that these groups have come together in opposition to Haftar, "probably [because they] see each other as their enemy's enemy", Gomati said.

On the other side, Haftar was able to gain support in the east because many in Cyrenaica and Benghazi have been unhappy about central government, which has left them feeling politically disenfranchised and economically marginalised, Gomati said. "They don't want to break up the state, but they want more devolution," explained Miles, the former ambassador.

Similar ideological positions have drawn together groups such as the February 17th Martyrs and Ansar al-Sharia in Benghazi. In Tripoli, the Chamber of Command of Libya Revolutionaries, affiliated with some members of the army staff, has fought alongside the Misrata armed groups, headed by the battle-hardened popular revolutionary figure Salah Badi. 

Live Box 201462110622169518

This does not translate, however, into a united fighting front of so-called Islamist groups across the country. Varying groups are "aligned but they're not the same", said Jason Pack, president of Libya-Analysis.com and a researcher at Cambridge University.

At the end of August, it was reported that Dawn of Libya rejected any desire to align with Ansar al-Sharia. Pack told Al Jazeera that fighters are not going back and forth between groups across the country. Nonetheless, while "ideology is not the most important factor, alliances play out because of ideological similarities," he said.

Arguing against a common framework of understanding the Libyan armed conflict, Professor Prashad told Al Jazeera that it is not a question of 'Islamists' versus 'secularists'. "It's impossible to say this is not ideological," but "within each of these militias there is a range of people", he said, including remnants of the Libyan Islamic Fighting Group, an armed group who opposed Gaddafi during the 1990s and played a role in the uprising against him in 2011.

The struggle for resources

The fight playing out today in Libya is also motivated by a struggle for resources.

Having filled the political vacuum left after Gaddafi's overthrow, competing armed groups received government-funded salaries in an attempt to draw the country's kaleidoscope of fighters into the political system. "The militias began to grow enormously", said former Ambassador Miles, and have developed an appetite for a continued inflow of resources.

"This is what it's really all about," said Ali Errishi, former Libyan minister for immigrations and expatriate affairs, explaining that putting armed groups "on the payroll... enabled them and financed trouble".

In the past days, it has been announced that Libyan oil production has risen to more than 725,000 barrels a day, more than six times the output level two months ago. Since the end of a blockade of Libya's oil ports by fighters loyal to leader Ibrahim al-Jathran, who has fought for greater independence for Libya's eastern region, al-Jathran has rejected the legitimacy of the National Congress in Tripoli.

Who will benefit from this new arrangement remains unclear. Errishi told Al Jazeera that oil revenues pass through the country's central bank. With members of Libya Dawn guarding the gates to the central bank, Errishi added that "the central bank is controlled by whomever is controlling Tripoli".

If we see more brigades going to one side over the other this will lead to civil war. The role of the regional environment is to help the domestic equation reach a deal.

- Zoheir Hamedi, Arab Centre for Research and Policy Studies

On September 2, Libya's central bank made the rare move of warning warring factions to respect its independence. "The central bank is the last defence line of state institutions and it is very important that it stays far away from political struggles," the bank said in a statement.

External influences

Discussing the role of the international community, a number of commentators including researcher Professor Prashad told Al Jazeera that it is important not to overestimate the importance of international actors in the conflict, who are secondary to the internal political configuration.

The UAE, which is home to Mahmoud Jibril, a leading politician opposed to Libya's Islamist groups, has been accused by the US of bombing sites held by Misrata forces with the help of Egypt.

Bordering Libya to to the east, Egypt's alleged involvement, which its government has denied, would constitute "a continuation of the counter-revolution in Egypt. This is a message to all Arab people that [the Egyptian government] will not accept a change in the political status quo in the Arab world," said researcher Hamedi. Discussing alleged interference by Egypt, Professor Prashad speculated that there is an attempt to "fully marginalise the strong showing of the Muslim Brotherhood in Libya."

It has also been alleged that Qatar, which plays host to Ali Salabi, a leading spiritual figure with close ties to the Muslim Brotherhood, has provided weapons and support to Brotherhood-affiliated groups battling former general Haftar.

"The UAE and Qatar are both playing a small role ... They are not major international powers," said Hamedi.

Nonetheless, thinktank Director Gomaty said the international community is sowing divisions by treating the Libya conflict in terms of a wider regional struggle, which has seen the UAE, Saudi Arabia and Egypt align against Qatar and Turkey in their support for the Muslim Brotherhood and its affiliates.

On Sunday, the House of Representative in Tobruk expelled Sudan's military attache from Libya, accusing Khartoum of sending munitions to Libya Dawn in Tripoli through Libyan airspace.

With the displacement of 100,000 people due to fighting in Tripoli and Benghazi, however, the Libya crisis may not yet have taken its worst turn. "If we see more brigades going to one side over the other," said researcher Hamedi, "this will lead to civil war. The role of the regional environment is to help the domestic equation reach a deal."

Follow Nouri Verghese on Twitter: @NouriVerghese

Source: Al Jazeera