TAHER ALI AL-AUQAILI, the chief of staff of Yemen’s army, has a spring in his step. After a year of stalemate, his five fronts are moving again. As he darts between battlefields hundreds of kilometres apart, he speaks of victories in Beihan, which have reconnected the road from his headquarters in Marib to southern Yemen, and in the Jawf region (see map). Troops have also advanced 60km north along the coast from Mokha towards Hodeida, the main port of the rebels, called the Houthis. From bases in the desert and coastal lowlands, the alliance of forces arrayed against the rebels is edging its way into the mountains that shelter Yemen’s capital, Sana’a, which is still in Houthi hands.

A string of events has led to the advance. In December the Houthis killed their erstwhile ally, Ali Abdullah Saleh, who had been Yemen’s president from 1978 to 2012, so the Houthis now fight alone. Arrests, killings and houses demolished by tank shells in the capital have stoked resentment against the rebels. Thousands of Mr Saleh’s people have fled.

Tales of rebel atrocities have spurred on the government’s forces. Fleeing Yemeni journalists say the Houthis killed over 30 colleagues, including some who worked for Mr Saleh’s media outlets. They say the rebels extorted money from relatives wanting to recover tortured bodies for burial. The Houthis, who claimed to champion the mathlumeen, or oppressed masses, may be turning into their oppressors.

As the rebels’ following shrinks, the army’s may be growing. The conflict has often been depicted as a sectarian one between the Iranian-backed Houthis, who follow the Zaydi branch of Shiism in the highlands, and Sunnis in the lowlands backed by their co-religionists in the Gulf. But the flight of hundreds of thousands of displaced Yemenis is changing the sectarian make-up in the army’s ranks. General Auqaili is a Zaydi from Houthi-held Amran. The new security chief in Marib comes from Amran, too. Moreover, he is a sayyid, one of the scions of the Prophet Muhammad, a group that Houthis think should rule the roost.

Mr Saleh’s death has also prompted the rancorous regional coalition assembled against the Houthis to bridge its differences. Muhammad bin Zayed, the de facto leader of the United Arab Emirates (UAE), had long distrusted Yemen’s army. Many of its soldiers support Islah, which has ties to the Muslim Brotherhood, an Islamist movement that the UAE abhors. Prince Muhammad had hoped that Mr Saleh would switch sides and boot the Houthis from power.

But since Mr Saleh’s death Prince Muhammad has reconciled with Islah. He has given army units loyal to the Islamists air support. Government forces are on the verge of breaking out of Taiz, Yemen’s third-largest city, besieged by the Houthis for almost three years. They hope to recapture all of the coastal plain, where the Houthis have little support.

But this would still leave the army far from total victory. The Houthis would be hard to winkle out of the highlands. Their mines, snipers and anti-tank missiles make progress through the passes painfully slow, complains General Auqaili. Moreover, before the Houthis ditched Mr Saleh, they took control of an arsenal of tanks and missiles from his Republican Guard, much of it supplied by America when it saw Mr Saleh as a bulwark against al-Qaeda.

By contrast, General Auqaili complains that his pleas for heavier weapons to match the Houthis go unanswered. The morale of his men is sapped because they are nine months behind with their pay. Some get by, selling weapons or information to the Houthis or al-Qaeda. So flush are arms bazaars that prices are 20% lower than before the war began in 2014.

Perhaps the biggest reason for the stalemate, however, is that many Yemenis benefit from it. Warlords and soldiers at checkpoints cream off humanitarian aid. Cities like Marib bask in the oil wealth and duties on electricity and imports that previously enriched the capital. Once notorious as a hotspot for kidnappings on behalf of al-Qaeda, it may now be Yemen’s safest city. Banks and schools function. Wages are paid on time. An oft-cited Yemeni adage holds that one people’s misfortune is another’s gain.