Yemen's warring parties have agreed to extend a four-month long truce just hours before it was due to expire, the UN envoy announced, vowing to "intensify" efforts to secure lasting peace.

Yemen has been gripped by conflict since the Iran-backed Houthi rebels took control of the capital Sanaa in 2014, triggering a Saudi-led military intervention in support of the beleaguered government the following year.

But a truce came into effect on 2 April and was renewed from 4 June, providing a rare respite from violence for much of the country and alleviating some of the suffering.

The latest two-month extension, running from 2 August to 2 October, "includes a commitment from the parties to intensify negotiations to reach an expanded truce agreement as soon as possible," the United Nations special envoy on Yemen, Hans Grundberg, said in a statement.

Hundreds of thousands have died, directly from fighting as well as indirectly, and millions have been displaced in what the UN has called the world's worst humanitarian crisis.

"The main objective of the current truce continues to be to provide tangible relief to civilians and to create a conducive environment for reaching a peaceful settlement to the conflict through a comprehensive political process," Mr Grundberg added.

More than two thirds of Yemen's 30 million people need humanitarian aid, a UN official said last month, and the country has been pushed to the brink of famine.

Hassan Razem, a ten-year-old child suffering from severe acute malnutrition in Hajjah province

"In the coming weeks, I will intensify my engagements... to ensure the full implementation of all the parties' obligations in the truce," Mr Grundberg said, adding he wanted to "put Yemen on a path to sustainable peace".

The truce has largely held, although the rival sides have traded blame over violations.

The European Union welcomed the extension and urged all sides to support UN peace efforts, saying the truce had brought "tangible benefits" and marked "the longest period of relative calm in Yemen in more than seven years".

US President Joe Biden welcomed the development and "a period of unprecedented calm" in Yemen, the White House said on Tuesday.

'Progress slowed'

Under the truce, commercial flights have resumed from the rebel-held capital Sanaa to Jordan and Egypt, while oil tankers have been able to dock in the lifeline port of Hodeida, also in Houthi hands.

The extension of the truce was also welcomed by aid agencies working to support those affected by the conflict.

"Millions of Yemenis are suffering due to rocketing food prices, a lack of health and other essential services and dwindling economic opportunities," said Abdulwasea Mohammed, from the aid agency Oxfam.

"Now is the time for all parties -- and the international community -- to work towards a lasting and inclusive peace that guarantees the lives, dignity and freedom of the Yemeni people."

On Monday, 30 aid agencies working in Yemen had said that since the truce first came into force on 2 April, "reports of civilian casualties have dropped significantly".

The aid groups, including Yemeni and international organisations, urged "all parties to the conflict to adhere to and extend the agreement to protect civilians" across the country.

But Erin Hutchinson, Yemen country director for the Norwegian Refugee Council, sounded a note of caution.

"After seeing swift and decisive action towards the success of the truce in the first months, progress towards meeting all of its elements has slowed," Ms Hutchinson said.

"We hope this two-month extension will allow for the reopening of roads linking cities and regions, enable more displaced people to return to their homes safely, and ensure humanitarian aid can reach people who have been out of reach for far too long."