The number of people killed fighting in the war in Yemen jumped to 3,068 in November, the first time it has exceeded the 3,000 mark in a single month since the start of the four-year conflict. This is about the same number as were being killed in Iraq at the height of the slaughter there in 2006.

The difference is that the Iraqis were not starving to death as is happening in Yemen. Aid organisations have long warned of mass starvation as 14 million hungry people are on the verge of famine, according to the United Nations. In a ruined economy, many Yemenis do not have the money to buy the little food that is available.

But at the last moment, just as millions of Yemenis were being engulfed by the crisis, a final calamity may have been averted.

On Thursday negotiators from the Saudi and UAE-backed forces and the Houthi rebel movement, meeting under UN auspices in Sweden, unexpectedly agreed a ceasefire in the port city of Hodeidah through which flows 70 per cent of Yemen’s food and fuel supplies. The Saudi-backed coalition forces and the Houthis have agreed to pull back their fighters from the city, which the coalition has targeted since June. It is the intensified fighting in and around Hodeidah that produced the spike in civilian and military fatalities.

The surprise breakthrough at the negotiations, which are meant to pave the way for full peace talks, has encouraging elements. Some 15,000 prisoners are to be exchanged and a humanitarian corridor is to be opened to the city of Taiz, which has long been a focus for the fighting.

Truce agreements after long periods of fighting are always shaky, as opposing fighters, locked in combat for years and regarding each other with the deepest suspicion, begin to disengage their forces. But, for once in Yemen, there are reasons for optimism, which have little to do with the warring parties themselves and everything to do with political changes in Washington and in the relations between the US and Saudi Arabia.

On the same day as the Hodeidah ceasefire was being announced in Sweden, the US Senate was unanimously approving a resolution holding Saudi Crown Prince Mohammad bin Salman – architect of the war in March 2015 – accountable for the murder of the journalist Jamal Khashoggi in Istanbul two months ago. Bob Corker, the Republican chairman of the Senate Foreign Relations Committee and sponsor of the resolution, said: “I absolutely believe [Mohammad bin Salman] directed… I believe he monitored it. And I believe he is responsible for it.” Earlier in the month, after a closed-door briefing from the CIA director Gina Haspel, Corker said: “If the crown prince had gone in front of a jury, he would be convicted in 30 minutes.”

This is rough stuff and came in the wake of a 56 to 41 vote in the Senate for a resolution ending US support for the Saudi-led war in Yemen. The Senate is also demanding the release of political prisoners held for supporting peaceful reforms such as rights for women.

President Trump and the White House are still standing by Saudi Arabia, but they are paying an increasingly heavy price for this protection. Republican senators as well as Democrats are leading the attack on the crown prince and the Saudi role in Yemen. This assault is going to get worse for the Saudis when the newly elected Democratic majority takes over the House next year and steps up the pressure on the administration over its close alliance with Saudi Arabia. Trump may find that at the end of the day he is more vulnerable over his Saudi connection than his links to Russia.

Even if Trump does go on protecting the crown prince and Saudi Arabia, he will look for something substantive in return. This is likely to include an end to the Yemeni war, which the US once supported primarily as a favour to the Saudis. It is a clear sign that the balance of power between Washington and Riyadh has changed radically in favour of the former.

A less obvious reason why the war in Yemen may come to an end is that neither side is in a position to defeat the other side. Many in Saudi Arabia and among its allies may have believed earlier this year that capturing Hodeidah would be a decisive blow against the Houthis, but this was always a misconception. The Houthis are expert and experienced guerrillas who would certainly fight on against the less capable Saudi-backed government forces. They may well see impending famine as strengthening them diplomatically because it will provoke greater international criticism of the Saudi intervention.

The war has always been seen as a personal project of the crown prince, which, as defence minister, he launched in March 2015 in expectation of a quick victory under the revealing code name “Operation Decisive Storm”. But instead of victory there was a military stalemate, though this did the Saudis little political damage until recently. They claimed with some success that their war was a counteroffensive against Iran and western leaders, and media commonly referred to the “Iranian-backed Houthi rebels”.

But Iranian support for the Houthis was always limited, reportedly consisting of free oil product delivered outside the country to the Houthis who then sold it for cash. It is a mistake to think that Iran or any other power in the Middle East necessarily needs to deliver arms and ammunition in crates. Much of the Middle East is a black market arms bazaar, and this has always been particularly true of Yemen. Anybody with money to pay for weapons will never lack an arms dealer willing to supply them.

Support free-thinking journalism and attend Independent events

After the Saudis failed to win the war quickly in 2015, they largely lost interest in it though they could not afford to bring it to an end without some sign of success. The human cost did not concern them as they were receiving military and diplomatic cover from the US, UK and France.

The international media shamefully paid little attention to the war until the Khashoggi affair: a measure of this lack of interest was the lazy way in which news outlets cited the number of Yemenis who had died violently in the conflict at just 10,000, quoting a two-year-old UN figure which was, in any case, an underestimate. It was only after the Armed Conflict Location and Event Data Project (Acled) meticulously counted the number of those killed since January 2016 that it emerged the true figure for fatalities was 60,223. Acled estimates that, when it has counted the number of dead in the first year of the war, the overall figure will rise to between 75,000 and 80,000, not including those who have died from famine or disease.