Yemen’s warring sides met at the negotiating table for the first time in two years on Thursday as the United Nations warned that half the country’s population could be vulnerable to famine if no solution is reached.

Representatives of Yemen’s internationally recognised government and Houthi rebels sat across from each other at the opening of the talks at a castle in Sweden.

Both sides have said they hope to reach an agreement to de-escalate fighting that has devastated the country.

UN envoy Martin Griffiths, who has engaged in intensive shuttle diplomacy for months, called the meeting “a milestone” and urged the two sides to “deliver a message at peace”.

The talks began with an announcement that the two parties had agreed to exchange some 5,000 prisoners as a confidence-building measure.

The stakes for Yemeni civilians could not be higher. Nearly four years into the civil war, at least 10,000 have been killed in the fighting and more than 22 million people rely on some sort of food assistance.

Malnutrition and disease are now rampant as basic services have collapsed. As many as 85,000 children may have already died from hunger, according to Save the Children, and many more are at risk. Mr Griffiths said on Thursday that half of Yemen’s nearly 30 million people could be at risk of famine if urgent action is not taken soon.

Yemen’s war was sparked by the takeover of the capital Sanaa by Houthi forces in 2014. The following year, the Houthis took over much of the country and forced out the internationally recognised government of President Abdu-Rabbu Mansour Hadi, prompting a Saudi-led coalition of Gulf countries to intervene on Mr Hadi’s side.

The fighting has created what is described as the world’s worst humanitarian disaster. Over the last five months, Yemen’s food crisis has been made significantly worse by fighting in the city of Hodeidah. Some 80 per cent of the country’s food and medical supplies come through the port, but fighting has stopped much of it coming in. After an intense battle last month, clashes in the city has slowed and both sides have reinforced their positions.

The UN hopes the negotiations in Sweden can prevent a full-scale assault on the city, and reopen the airport in the capital Sanaa – where access is restricted by Saudi control of Yemeni airspace.

The beginning of the talks coincided with the release of a World Food Programme survey which found that 15 million people are in a “crisis” or “emergency” situation and that number could hit 20 million without sustained food aid. The report also discovered that some 65,000 people were experiencing “catastrophic” food conditions, mostly in areas where fighting is taking place. That number could rise to more than 230,000, it added.

Johan Mooij, Yemen country director for CARE International, said the report should be a “wake-up call for the world”.

He said: “Without humanitarian assistance here in Yemen, almost a quarter of a million people would immediately be in famine, and a staggering 20 million people would not have enough to eat – all because of a manmade crisis. The tragedy here grows worse by the day, stretching the limits of what CARE and other humanitarian groups can do to alleviate misery and prevent more deaths.”

The WFP said it is planning to scale up food distribution to another four million people over the next two months, increasing the number of people it supports to 12 million.

Brutal effects of Yemeni war Show all 12 1 /12 Brutal effects of Yemeni war Brutal effects of Yemeni war Yemen organised by the UAE's National Media Council shows a Yemeni woman holding a child diagnosed with malnutrition at a hospital in the southeastern port city of Mukalla, the capital Hadramawt province AFP/Getty Images Brutal effects of Yemeni war Mohamed, 2, is treated for Malnutrition in Mukalla, the capital Hadramawt province, Yemen Bel Trew Brutal effects of Yemeni war a trip in Yemen organised by the UAE's National Media Council (NMC) shows a Yemeni woman holding a child diagnosed with malnutrition at a hospital in the southeastern port city of Mukalla, the capital Hadramawt province. AFP/Getty Images Brutal effects of Yemeni war UAE's National Media Council (NMC) shows a Yemeni woman sitting next to a child diagnosed with malnutrition at a hospital in the southeastern port city of Mukalla, the capital Hadramawt province. AFP/Getty Brutal effects of Yemeni war A picture taken on August 7, 2018 during a trip in Yemen organised by the UAE's National Media Council shows Yemeni women attending to children diagnosed with malnutrition at a hospital in the southeastern port city of Mukalla, the capital Hadramawt province. (Photo by KARIM SAHIB / AFP) (Photo credit should read KARIM SAHIB/AFP/Getty Images) AFP/Getty Images Brutal effects of Yemeni war Mohamed, 2, is treated for Malnutrition in Mukalla, the capital Hadramawt province, Yemen Bel Trew Brutal effects of Yemeni war A Yemeni child suffering from malnutrition is weighed at a hospital in the northern district of Abs, in Yemen's Hajjah province AFP/Getty Images Brutal effects of Yemeni war A Yemeni child suffering from malnutrition awaits treatment at a hospital in the northern district of Abs, in Yemen's Hajjah province AFP/Getty Images Brutal effects of Yemeni war A Yemeni child suffering from malnutrition awaits treatment at a hospital in the northern district of Abs, in Yemen's Hajjah province AFP/Getty Images Brutal effects of Yemeni war Yemeni nurses weigh a malnourished child at a hospital in the northern district of Yemen's Hajjah province AFP/Getty Images Brutal effects of Yemeni war A Yemeni woman carries a malnourished child as she waits during food distribution in the province of Hodeida AFP/Getty Brutal effects of Yemeni war A Yemeni child suffering from malnutrition is measured at a hospital in the northern district of Abs, in Yemen's Hajjah province on August 18, 2018. (Photo by ESSA AHMED / AFP) (Photo credit should read ESSA AHMED/AFP/Getty Images) AFP/Getty Images

But the delivery of that aid is dependent on whether the two sides can reach an agreement in Sweden. Few are optimistic that these talks will produce a comprehensive agreement, but UN diplomats hope a series of confidence-building measures will open the way to further negotiations.

On Thursday, Mr Griffiths confirmed: “I’m also pleased to announce the signing of an agreement on the exchange of prisoners, detainees, the missing, the forcibly detained and individuals placed under house arrest. It will allow thousands of families to be reunited, and it is the product of very effective, active work from both delegations.”

Whether a broader deal on the conflict can be agreed remains to be seen. Saudi Arabia intervened in Yemen in 2015 to counter Iranian influence – the takeover of the Iran-aligned Houthi movement in a neighbouring country was seen as a major threat.

Riyadh’s deadly air campaign has been carried out with support from the West. Coalition jets, backed by US logistical support and using weapons made in the US and the UK, have repeatedly hit targets where no militants were present. The coalition has admitted to causing civilian casualties in the past, but attributes the deaths to “unintentional mistakes”, and says it is committed to upholding international law.