RIMBO, Sweden — Yemen's warring sides have agreed to a withdrawal of troops from the contested Red Sea port city of Hodeida and a province-wide cease-fire, the United Nations secretary general announced Thursday.

Antonio Guterres thanked the Yemeni delegations that attended week-long peace talks in Sweden for what he called "an important step" and "real progress toward future talks to end the conflict."

The brutal four-year-old civil war 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 million of Yemen's 29 million people in need of aid, according to the United Nations. The two sides have for months been locked in a stalemated fight over Hodeida.

U.N. envoy Martin Griffiths has said he wants to remove Hodeida from the conflict so that aid deliveries can operate freely.

The U.N.-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.

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, which backs the Saudis, has called for a cease-fire and reduced some of its logistical aid for the Saudi-led coalition.

Guterres said that the next round of talks is planned for the end of January.