DUBAI (Reuters) - Yemen’s warring parties have failed to leave the main port city of Hodeidah more than two months after agreeing to a U.N.-led truce deal as part of efforts to end the almost four-year war that has pushed the country to the brink of famine.

The two sides agreed at December consultations in Sweden, the first in two years, on a ceasefire and troop withdrawal from Hodeidah in the first major breakthrough in peace efforts.

The truce has largely held but the withdrawal has yet to materialize amid deep mistrust between the Iran-aligned Houthi movement, which controls Hodeidah, and the Saudi-led coalition trying to restore the ousted government of Abd-Rabbu Mansour Hadi.

WHY HASN’T THE DEAL BEEN IMPLEMENTED?

The Sweden agreement never spelled out which local authority would take control after fighters withdrew. The Houthis hold Hodeidah while other Yemeni fighters backed by the coalition are positioned on the outskirts of the city.

On Dec. 29, the Houthis started leaving Hodeidah port and handed over to local coast guards. The coalition objected, saying those units were loyal to the movement.

A U.N. observer team headed by retired Dutch Major General Patrick Cammaert had no verification mechanism in place to assess the local units and struggled to bring the two sides together for talks. He resigned in January and handed over to a Danish general, Michael Anker Lollesgaard, who relaunched meetings on a ship off the coast of Hodeidah.

After weeks of diplomacy that also involved special envoy Martin Griffiths, the United Nations announced on Feb. 7 that a preliminary agreement had been reached for a phased approach.

The Houthis were due within days to withdraw 5 km (3 miles) from the port of Saleef, used for grains, and Ras Isa oil terminal. They would also clear the areas of landmines and heavy weaponry.

After the move was verified, the group would pull out of Hodeidah port alongside a coalition retreat of 1 km from the “Kilo 7” eastern suburb of the city, where battles raged before the ceasefire went into force on Dec. 18.

But the U.N. is still trying to bridge the gap between both sides on the local authority that would take over under U.N. supervision, before a wider redeployment in the second phase.

There are several proposals on the table, including agreeing a common list of coast guards and police force members.

The Houthis also doubt that the coalition will actually retreat after they move out.

WHY IS HODEIDAH SO IMPORTANT?

The port handles the bulk of Yemen’s commercial and aid supplies and is critical for feeding the population of 30 million people in the poorest country in the Arabian Peninsula.

It became a focus of fighting last year, raising concern that a full-scale assault could so disrupt supply lines there would be mass starvation in a country where 16 million people face severe hunger. The fighting has made it difficult to open humanitarian corridors.

After years of military stalemate, the Sunni Muslim coalition led by Saudi Arabia and the United Arab Emirates twice launched an offensive last year to seize the port, seeking to weaken the Houthis by cutting off their main supply line.

Saudi Arabia and the UAE want to exit a costly war that has come under increased scrutiny following the murder in October of Saudi journalist Jamal Khashoggi at the kingdom’s Istanbul consulate.

The Western-backed alliance intervened in Yemen in 2015 to restore Hadi’s government, which now holds the southern port city of Aden and string of coastal towns. The Houthis control most urban centres including Sanaa.

If the Hodeidah deal fails, chances are slim for further peace talks to agree a framework for political negotiations to end the conflict, which has killed tens of thousands of people.

WHY IS THE CONFLICT SO COMPLEX?

Yemen’s fractious armed groups and parties, numerous before the war, have proliferated further since 2015, and they all have their own agenda. The war also revived old strains between North and South Yemen, formerly separate countries that united into a single state in 1990 under slain former President Ali Abdullah Saleh.

Southern separatists resented concentration of resources in the north. Although from the north, the Shi’ite Zaydi sect chafed as their stronghold in Saada became impoverished. In late 1990s, they formed the Houthi group, fought the army and forged ties with Iran. Jihadists set up an al Qaeda wing in the south.

Mass pro-democracy protests in 2011 forced Saleh to step down after some of his former allies turned on him and the army split. His deputy, Hadi, was elected to a two-year term to oversee a democratic transition, but was undermined.

In 2014 the Houthis, aided by Saleh loyalists, seized Sanaa forcing Hadi to share power. When a federal constitution was proposed, both Houthis and southern separatists rejected it.

The Houthis arrested Hadi in 2015, but he escaped and fled to Aden. The coalition then entered the war on Hadi’s side.