THREE times the strongman of Yemen, Ali Abdullah Saleh, promised to sign an agreement to step down, and three times he reneged. Twice he left the country for medical treatment — most recently heading to the United States — only to disappoint most of his countrymen by returning home again.

Now at last it appears that the Arab world’s poorest country — and strongest base for al-Qaeda — will rid itself of the man who has dominated it for 33 years. Last week, Mr. Saleh’s vice president drew strong support in a one-candidate election to take over as Yemen’s president. On Saturday, Abed Rabbo Mansour Hadi was sworn in, and news agencies report that Mr. Saleh, granted immunity for his crimes, is preparing to leave for exile in Ethi­o­pia.­­

That amounts to something of a breakthrough for Yemen, which has been paralyzed for a year by a multi-sided struggle for power. Mr. Saleh’s departure is an achievement for the United States — a longtime backer of his government — as well as for Persian Gulf states that brokered the transition. Still, it is just a beginning to the task of restoring stability, rebuilding the economy, nourishing a promised democracy and eliminating the threat posed by al-Qaeda.

One danger is that the United States will focus on the last of those goals at the expense of the other three. Tellingly, the administration’s point man for Yemen has been White House counterterrorism adviser John O. Brennan, who has visited the country seven times in three years. The administration is rightly pushing for a reorganization of Yemen’s security forces that would strip clout from individual commanders who now act as virtual warlords. It is not clear, however, whether Mr. Saleh’s son and nephews, who command key units, would be disempowered. If they are not, they might try to perpetuate their father’s autocracy.

The administration plans to continue drone strikes and other special operations against key al-Qaeda figures while pushing the reorganized army to retake ground seized by al-Qaeda in the south. Separatists in the north, possibly backed by Iran, must also be dealt with, by negotiation or force. But if Yemen is to be stabilized for the longer term, Mr. Hadi’s government must be pushed to follow through on a promised dialogue with Yemen’s pro-democracy movement, on a new constitution and on preparations for genuinely democratic elections in two years.

Until now, the students and civil society leaders who started Yemen’s revolution a year ago, and who have survived bloody attacks by Mr. Saleh’s forces, have been left out of the transition plan. Their demands that Mr. Saleh be held accountable for his repression have been disregarded. Perhaps that was necessary to defuse a conflict that threatened to turn into civil war or Somalia-style anarchy. But if the United States continues to trade short-term security interests for Yemen’s economic development and political liberalization, it will pay the price when that huge and restless younger generation comes into power.