SANAA, Yemen -- An informal agreement to reduce hostilities between Saudi-led coalition forces and rebels in and around Yemen's Red Sea port city of Hodeida has taken hold, military officials said Tuesday, in a move that could be a prelude to peace talks that would end the ruinous war in the poorest Arab country.

The officials said hostilities have ceased for the second consecutive day, with both sides respecting the truce. Only three coalition airstrikes were carried out in the last 24 hours, targeting rebel positions outside the city.

The truce followed advances by the coalition in their latest attempt to retake the city from the Shiite rebels, known as Houthis, with its forces now 5 kilometres (3 miles) short of the port, Yemen's traditional lifeline.

The officials said efforts were being made to persuade the Houthis to abandon the city and hand over control to an independent Yemeni party that would run the port under U.N. supervision. The Houthis, who had in the past rejected the proposal, said the coalition accepted the truce because of its heavy casualties and because it came under international pressure to spare some 500,000 civilians inside the city the death and destruction that come with street-to-street fighting, which already began this week.

The military and Houthi officials spoke on condition of anonymity because they were not authorized to brief the media.

The U.N. envoy to Yemen, Martin Griffiths, welcomed the reduction of hostilities and said it was a "crucial step" to prevent further humanitarian suffering.

"I call upon all parties to the conflict to show continued restraint. The people of Yemen have suffered enough. I am confident that the parties are ready to work on a political solution and am encouraged by the constructive engagement received from all sides," he said in a statement.

Griffiths, said the statement, reassured the warring sides that the U.N. remained ready to re-engage the parties on a negotiated agreement for Hodeida, which would protect the port and preserve the humanitarian pipeline.

The coalition has been battling the rebels on the side of Yemen's internationally recognized government since March 2015 in a war that has killed tens of thousands of people and pushed much of the country to the brink of starvation.