UN-brokered truce is expected to start at midnight on Monday, but fighting is threatening to derail the historic deal.

Yemen’s warring parties agreed to a ceasefire in the Red Sea city of Hodeidah last week, a major breakthrough that was expected to end violence in the flashpoint city.

After a week of consultations in the Swedish town of Rimbo, representatives from the Houthi movement and the government of President Abd-Rabbu Mansour Hadi agreed to pull back their fighters to allow the deployment of UN-supervised neutral forces and the establishment of humanitarian corridors.

But just a day after the historic truce was reached, clashes erupted between the opposing sides.

At least 30 fighters have been killed in the past three days and the intermittent violence threatens to upend the hard-won accord.

Who’s fighting who and why?

Since 2014, Yemen has been wracked by a multi-sided conflict involving local, regional, and international actors.

The Houthis, a group of Zaidi Shia Muslims who ruled a kingdom there for nearly 1,000 years, exploited widespread anger against President Hadi’s decision to postpone long-awaited elections and his stalled negotiations over a new constitution.

18113009571188

They marched from their stronghold of Saada province to the capital Sanaa and surrounded the presidential palace, placing Hadi under house arrest.

Prompting one of the world’s worst humanitarian crises in decades, a military coalition led by Saudi Arabia intervened on March 26, 2015, at Hadi’s request, after the Houthis continued to sweep the south and threatened to conquer the last government stronghold of Aden.

After the coalition and local militias successfully fended off the Houthi takeover of Aden, they believed retaking Hodeidah could potentially open a pathway to Sanaa.

But since late October, Western powers, outraged by the killing of Jamal Khashoggi and the ensuing humanitarian disaster in Yemen, called on both sides to come to the negotiating table.

After months of intense diplomacy, the office of the UN envoy for Yemen, Martin Griffiths, managed to bring together the warring parties in Sweden where they agreed to a host of confidence-building measures, including a plan for the Houthis and pro-government forces to gradually leave the embattled city, a mass prisoner swap and an agreement to establish a humanitarian corridor in the province of Taiz.

What’s the situation in Hodeidah right now?

While the clashes have been restricted to southern neighbourhoods of Hodeidah city, the sound of gunfire and mortar fire were heard throughout much of the city on Monday.

According to residents, the coalition resumed its air attacks on Friday, and tens of thousands of troops, drawn from local militias, southern separatists and units loyal to the country’s former president, had amassed on the city’s outskirts.

Al-Masirah, a pro-Houthi TV network, reported that at least four people, including a child, were injured in one attack on Monday.

However, one source said the port, which is a major lifeline for millions of Yemenis facing starvation, was spared from the latest round of clashes.

What is the ceasefire and when does it come into effect?

According to the UN, a ceasefire by the parties will come into effect in the city and the three ports of Hodeidah, Ras Isa and Saleef at midnight local time (21:00 GMT) on Monday.

The Houthis will withdraw from the ports, which have been under their control since 2014, in the next 14 days and pull out completely from Hodeidah city over the next 21 days.

A UN-chaired committee including both sides will oversee the withdrawal of forces.

As part of the agreement, the ports will fall under the control of “local forces”, who would then send the ports’ revenues to the country’s Central Bank.

Yemen’s Foreign Minister Khaled al-Yamani declined to specify whether the forces would be solely state security forces but said they would report to the “central authority”.

The Central Bank will then begin paying the salaries of government employees in Houthi-held areas.

As many as 1.2 million civil servants have not received their salaries in nearly two years, leaving health, education and sanitation services without the people and resources needed to keep them running.

What happens next?

The deal, if implemented on the ground, will represent a breakthrough because the port is the gateway for the bulk of humanitarian aid coming into the country.

By demilitarising Hodeidah, the UN will deliver aid to those living in areas whose supply routes have been cut off by fighting since June.

While a second round of talks is already expected to be held in January, a smooth ceasefire could lead to a fast framework for negotiations and a transitional governing body.

The Houthis, who have little to no support in the south, want a meaningful role in Yemen’s government and to rebuild their stronghold of Saada in the north of the country.