SANA, Yemen — After more than three decades of autocratic rule, President Ali Abdullah Saleh signed an agreement on Wednesday that immediately transferred power to his vice president, bowing to unrelenting street protests and raising hopes for an end to a political crisis that brought this impoverished nation to the brink of collapse.

If the agreement holds up, it will make Mr. Saleh the fourth Arab leader to be forced from power this year by popular uprisings that have shaken the Middle East and North Africa. But the deal offers no guarantee that it will restore calm to a nation fractured by 10 months of political instability and suffering from a power vacuum that groups linked to Al Qaeda have exploited with increasing boldness.

Troubled by the collapse of security, the United States, other Western powers and Persian Gulf leaders had aggressively pushed for the agreement, even as protesters argued that it would preserve the status quo by keeping the country’s elite, including members of Mr. Saleh’s family, in power. On Wednesday, some of the movement’s leaders indicated that they would not back down without more fundamental changes.

It remains unclear how the country’s interim leaders will resolve a bitter three-way power struggle between Mr. Saleh and two rivals — including a renegade general who commands well-armed defectors — that has recently eclipsed the popular protests.