Yemen's warring sides have agreed to provincewide ceasefire in Hodeida and a withdrawal of troops from the contested Red Sea port city after weeklong peace talks in Sweden.

United Nations mediators hoped the deal would re-open humanitarian corridors into the war-ravaged country and signal a shift toward ending the four-year-old civil war.

UN Secretary General Antonio Guterres thanked the Yemeni delegations for making "real progress toward future talks to end the conflict" and said the next round of talks is planned for end of January.

The conflict pits the internationally recognized Yemeni government, supported by a Saudi-led coalition, against the Iran-backed rebels known as Houthis.

The fighting has produced one of the world's worst humanitarian crises, with 22 of Yemen's 29 million people in need of aid, according to the UN. The two sides have for months been locked in a stalemated fight over Hodeida.

"This is just the beginning," Guterres said at the closing ceremony for the talks in the Swedish town of Rimbo.

He thanked the Yemeni parties "for coming here to discuss a better future for Yemen."

Yemenis loyal to Houthi rebels hold up their weapons in a show of support for the peace talks in Sweden. (Hani Mohammed/Associated Press)

The UN said Guterres feels his talks with Saudi Crown Prince Mohammad bin Salman and Yemen's President Abed Rabbo Mansour Hadi helped achieve the agreement.

UN deputy spokesperson Farhan Haq told reporters at UN headquarters in New York on Thursday that Guterres felt the Saudi crown prince's contribution "was very important to the outcome of the consultations" and that Hadi "played a positive role."

The secretary general thanked those inside and outside the region that tried to encourage the parties to make progress at the talks in Sweden and believes this was "valuable" in reaching Thursday's agreement, Haq said.

He said UN special envoy for Yemen Martin Griffiths, who led the talks, and UN humanitarian chief Mark Lowcock will brief the UN Security Council on Friday on the outcome.

Haq said certain aspects of the agreement, including UN monitoring of the port of Hodeida, "might need Security Council approval," which would require a new resolution.

'Pivot first step'

U.S. Secretary of State Mike Pompeo welcomed Thursday's agreements and said they were a "pivotal first step" in ending the devastating conflict and that all parties must continue to de-escalate tensions and expand the truce.

The UN-sponsored talks had low expectations for halting the conflict immediately, but saw some progress with the agreement of a prisoner swap to include some 15,000 people at the start of the talks last week. The exchange is to take place by Jan. 20, 2019.

Both sides have said they sought to build on goodwill for future talks, although it was unclear how far they have come in agreeing on a draft agreement given to them a day earlier to consider by Griffiths, who has said he wants to remove Hodeida from the conflict so that aid deliveries can operate freely.

Draft agreement details post-war Yemen

On Wednesday, the UN raised expectations for progress in the talks saying that the UN envoy had given both sides a draft agreement for consideration.

The document consists of a set of proposals, including one for a political framework for a post-war Yemen, the reopening of the airport in the capital of Sanaa and a proposal for Hodeida, a lifeline for millions of Yemenis dependent on international aid.

The UN draft proposal was not released to the media. A draft document obtained by The Associated Press earlier this week showed an initial 16-point proposal to stop all fighting and have all troops withdraw to the city limits of the key port of Hodeida, and later from the surrounding province of the same name.

Over 28,000 killed this year

The mounting humanitarian needs in Yemen and outrage over the killing of Saudi writer Jamal Khashoggi have galvanized international support for ending the war. The United States, a backer for the Saudis, has called for a ceasefire and reduced some of its logistical aid for the Saudi-led coalition.

Also, an international group tracking the war said this week that the conflict in Yemen has killed more than 60,000 people, both combatants and civilians, since 2016.

The U.S.-based Armed Conflict Location & Event Data Project (ACLED) said in a report Tuesday that more than 28,000 people — again both civilians and combatants — were killed in the first 11 months of 2018, an increase of 68 per cent from 2017. More than 3,000 were killed in November, the deadliest month since ACLED started collecting data.

The group said 37 per cent of the total number of civilians killed in Yemen in 2018 died in Hodeida. ACLED bases its figures on press reports of each incident of violence in the war.

ACLED's figures also do not include the last few months of 2014, when Yemen's Houthi rebels captured Sanaa and much of the country's North, nor the casualties in 2015, when the Saudi-led coalition joined the war on the side of Hadi's government.