UN's envoy to Yemen, Ismail Ould Cheikh Ahmed (C)

A UN envoy expressed optimism late Wednesday that a humanitarian pause in the fighting in Yemen can still be reached in the two remaining weeks of Ramadan, to allow aid into war-ravaged country.

"We are still optimistic that we'll obtain it," Ismail Ould Cheikh Ahmed told AFP in the Saudi capital Riyadh, after a second day of talks with Yemen's government in exile.

United Nations Secretary General Ban Ki-moon appealed for an immediate two-week humanitarian ceasefire before the Muslim holy month of Ramadan began on July 18.

"We are discussing this with all the constituent parties," Ould Cheikh Ahmed said, on the same day the UN declared its highest-level humanitarian emergency in Yemen.

More than 80 percent of the country's population need aid and the health system faces "imminent collapse", the UN says.

A five-day pause proposed by Saudi Arabia allowed some aid into Yemen in May before a Saudi-led coalition resumed air strikes, blaming ceasefire violations by Iran-backed Huthi rebels.

The coalition has been bombing the Huthis since March 26 in support of Yemen's President Abedrabbo Mansour Hadi, who fled to Saudi Arabia from the rebels' advance.

UN peace talks in Geneva collapsed last month and Ould Cheikh Ahmed told AFP there is no "immediate plan" for a resumption.

"We prefer to go shuttling between the two parties until we can reach an agreement," he said.

The envoy plans to visit the rebel-held Yemeni capital of Sanaa on Sunday for talks with Huthis and members of former president Ali Abdullah Saleh's General People's Congress party.

The aim, he told reporters, is "to reach a unified (agreement) hopefully before the end of Ramadan".

He said there are "some guarantees" that any future truce will be respected more than the last one.

"What's best is to have a comprehensive agreement, including monitors, to affirm that a truce is respected," he said.