The United Nations' special envoy to Yemen, Martin Griffiths

Yemen's warring parties have agreed on a ceasefire in the embattled port province of Hodeida, UN Secretary General Antonio Guterres said Thursday, on the last day of negotiations aimed at ending the country's four-year war.

Addressing the closing session of the discussions in the Swedish town of Rimbo, Guterres said the agreement would see mutual redeployment of forces from the crucial Hodeida port.

It was not immediately clear when the province-wide truce would take effect.

"This will facilitate humanitarian access and the flow of goods to the civilian population, and it will improve the living conditions for millions of Yemenis," he said. 

Hodeida, in western Yemen, is strategically important because of its vital port, which is the entry point for some 80 per cent of Yemen's imports and aid.

In June, a Saudi-led coalition backing the Yemeni government began a major offensive to seize Hodeida, which has been under the control of Iran-backed rebels since late 2014.

Guterres hailed the agreement on Hodeida as "real progress."

He added that both sides would meet for a new round of talks late next month. He did not give a specific date or venue.

"There is a long way to go, lots of agreements needed, it is just a beginning, but at least it's the beginning of a process," Guterres said.

The United Nations' special envoy to Yemen, Martin Griffiths, on Thursday told a press conference in Rimbo that the UN would play an "important role" at the Hodeida port, without giving details.

Saudi ambassador to the United States, Khalid bin Salman, said that his country and the coalition fighting the Houthis "strongly support the agreement" as a "major step towards alleviating the humanitarian crisis and reaching a political solution."

"The agreement announced today will help bring back security to the region including the security of the Red Sea, a vital waterway for international trade," Khalid wrote on his Twitter account.

"We hope that the Houthis accept a comprehensive political solution, in accordance with relevant UN resolutions, that serves the interests of Yemen and its people rather than working on behalf of the Iranian regime's interests," added Khalid, the brother of Saudi Arabia's powerful Crown Prince Mohammed bin Salman.

Since March 2015, Saudi Arabia has been leading a Sunni alliance that has been supporting the government forces with airstrikes.

The Norwegian Refugee Council (NRC) said it welcomed Thursday's announcements "with relief and optimism."

"If implemented in full by all parties, the actions agreed today could have the power to change the course of the crisis in Yemen," said Jan Egeland, NRC secretary general.

"Promises made in Sweden will only be meaningful when civilians in Yemen see a cessation of hostilities, safe corridors for the movement of people and supplies, and concrete steps to restore the nation's collapsing economy," he added.

Delegations from the Saudi-backed government and the Houthi rebels have been in the Swedish town of Rimbo, north of Stockholm, since December 6 for their first talks in more than two years.

On Thursday, the chiefs of the government and rebel teams were seen giving each other a landmark handshake at the televised closing session.

On Tuesday, the government and the rebels exchanged lists of names of around 16,000 prisoners as part of a swap deal that will come into effect by January 19.

Yemen, one of the Arab world's poorest countries, has been embroiled in a power struggle between the government and the rebels since late 2014.