Move is part of deal with Riyadh to end infighting between southern separatists and internationally recognised gov’t.

The United Arab Emirates has said it has completed the withdrawal of its troops from Yemen’s southern port city of Aden as part of a deal brokered with Saudi Arabia to end a power struggle between southern separatists and the internationally backed government of President Abd-Rabbu Mansour Hadi.

A statement published by state news agency WAM on Wednesday quoted the military as saying Emirati troops had returned home and that the UAE has handed over control to Saudi Arabia and Yemeni forces.

The statement added that the UAE would continue fighting “terrorist organisations” in other southern Yemeni provinces.

The move came days after the UAE-backed separatist Southern Transitional Council (STC) and Hadi’s Saudi-backed government agreed to an initial deal designed to end infighting in Yemen’s south.

The two sides are nominal allies in a Saudi-UAE-led military alliance, which first intervened in Yemen in March 2015 to restore Hadi’s government shortly after it was removed from Sanaa by Houthi rebels.

In August, the UAE-backed separatist movement, which seeks self-rule in southern Yemen, turned on Hadi’s government as its forces seized their interim seat of Aden.

Weeks of bloody infighting stoked fears of a further weakening of the anti-Houthi bloc and undermining chances for finding a negotiated solution to the civil war.

But negotiations in Saudi Arabia managed to halt fighting in Aden, quickly ending a new front in the war.

A leaked draft of the Saudi-brokered deal stipulates that both the STC and the Yemeni government would share power in a joint cabinet while working with the Saudi-UAE coalition to battle the Houthis.

Riyadh has sought to refocus the coalition on fighting the Houthis on its border, who have repeatedly launched missiles and drone attacks on Saudi cities during the conflict.

The war in Yemen has claimed tens of thousands of lives, pushed millions to the brink of famine and spawned the world’s most devastating humanitarian crisis.