By Ulf Laessing, Aidan Lewis and Ayman al-Warfalli

CAIRO/BENGHAZI, Libya (Reuters) - Libya's combatants are readying for a long conflict, as foreign weapons flood in, eastern factions close oil ports and rival alliances wrangle over revenues from Africa's largest petroleum reserves.

The moves signal deepening animosity in a war that could worsen regional instability and swell the flow of migrants from the Middle East and Africa almost a decade after Muammar Gaddafi's fall in 2011.

From his large villa in Libya's east, tribal leader Sanoussi al-Zwai sees plenty more trouble ahead for the huge country, for years contested by two rival authorities in the east and west.

He is an ally of Commander Khalifa Haftar, whose self-styled Libya National Army (LNA) also has the support of Egypt, the United Arab Emirates (UAE), Jordan and Russian mercenaries as it tries to capture the capital Tripoli.

Zwai's tribe backs the oil port blockade, resisting calls by the United States and the United Nations to restart flows of Libya's vital income source, which is run by Haftar's foe, the internationally recognized Government of National Accord (GNA).

Zwai's price for unlocking the ports is for the GNA, based 1,000 km (620 miles) away in Tripoli, to funnel more income to his people. If the GNA resists, he suggests there could be worse to come.

"We are not happy with what is happening now, but we have ways to escalate if the international community does not listen to us," said Zwai, leader of a tribe living near eastern oil facilities.

"There will be a major escalation. We have other things (means) to use at the time. If it comes to it, the world knows what escalation is," he told Reuters in the main eastern city of Benghazi, without saying what any escalation would involve.

RACING TO REARM

The standoff over oil is only one of several factors that could prolong the almost year-long conflict over the capital, where the GNA last month secured military backing from Turkey including Turkish-backed fighters from Syria.

The combatants are racing to rearm, receiving shipments both before and after foreign backers agreed to enforce a truce at a summit in Germany in January. The inflow of advanced artillery and fighters and advisers breaches pledges made in Berlin to respect an arms embargo, diplomats say.

On Thursday, the U.N. Security Council called for a ceasefire but Russia, a Haftar backer, abstained from the vote. Diplomats took this as sign that Moscow might not be committed to a U.N.-led political mediation.

Haftar's forces and their foreign backers have stopped fighter jet strikes on the capital. But Western diplomats and experts say this is not due to a genuine desire for peace but because of better air defenses supplied by Turkey.

Until Turkey's intervention, Tripoli officials had started to panic they might lose the capital, the diplomats said.

Instead, Syrian fighters sent by Turkey have helped reverse small LNA gains, restoring frontlines to roughly where they settled just after the LNA attack began in April 2019.

Estimates from diplomats in Turkey about the number of Syrian fighters vary from 1,500 to 3,000, while the number of Turkish troops was seen at between 200 to 500 including special forces, conventional troops and drone operators.

"Both sides are preparing for the next battle," said a Western diplomat.

Diplomacy repeatedly founders on mutual suspicions.

"Each time we have any kind of agreement ... we always saw the same pattern," said Taher el-Sonni, the GNA ambassador to the U.N. "It's more like gaining time, then (Haftar decides to) just use force."

Turkey has sent heavy trucks by sea, while the UAE flew in 89 shipments totaling 4,680 metric tons between Jan 12 and Feb 16, according flight tracking data and a security source. The UAE did not immediately respond to a request for comment.

CONTROL OF OIL WEALTH

Newly-shipped big guns are already making their presence felt, as shelling from long-range artillery blamed on the LNA hit the city center for the first time this week.

Away from the Tripoli battle, which has displaced at least 150,000 people, the conflict has shifted to the control of oil wealth. Forces allied to Haftar have kept the ports shut for a month, causing losses of some $1.4 billion.

The blockade echoes complaints of neglect going back to Gaddafi, who punished the east for dissent in his long rule.

The National Oil Corporation (NOC), which says it is neutral and deals with all sides in the conflict, blames the LNA for directly ordering the shutdown.

Pressure from international powers and the United Nations has so far failed to persuade Haftar to reopen the ports and the southern El Sharara oilfield, Libya's largest. The veteran commander has even won some new recognition from Western countries that oil revenues need to be distributed fairly.

A senior U.S. diplomat said it was important that oil revenues are distributed equally, something he said should be discussed in U.N.-led intra-Libyan economic talks, part of a mediation to overcome divisions.

Neither side discloses how much it spends on the conflict.

Diplomats say the Tripoli government is less dependent on oil than before, as up to a third of the budget is covered by a fee it levies on all private transactions involving hard currency. Some of the Syrian fighters sent by Turkey are paid directly by Tripoli, diplomats say.

A stalemate looms. On Friday Haftar dashed hopes of a truce, saying there would be no peace until "militias" holding Tripoli had been defeated. For its part, Tripoli demands the LNA pull back 1,000 km (620 miles) east, something Haftar rejects.

"We don't expect to reach a ceasefire unless these troops (LNA) go back where they came from," said GNA Interior Minister Fathi Bashagha.

(Additional reporting by Dominic Evans; Writing by Ulf Laessing, Editing by William Maclean)