Yemeni President Ali Abdullah Saleh and the country's top general are hashing out a political settlement in which both men would resign from their positions within days in favor of a civilian-led transitional government, according to three people familiar with the situation.

The outlines of that peaceful transition emerged amid rising tension over the standoff between the President Saleh and Gen. Ali Mohsen al-Ahmar, who earlier this week broke ranks and declared his support for the array of protesters demanding that the president step down immediately.

Opposing tanks from units loyal to Mr. Saleh and to Gen. Ahmar have faced off in the streets of San'a all week and tens of thousands of anti-government demonstrators continued their vigil in the capital's Change Square.

The people familiar with the negotiations said Thursday that Mr. Saleh and Gen. Ahmar are intent on preventing bloodshed and preserving stability in the Arabian Peninsula nation. Aides to both men said that while they both understand that Mr. Saleh's continued rule is untenable, they have agreed that the timing of his resignation can't happen until they have worked out the details of a transitional governing council that would take his place. They hope to have a detailed plan ready by Saturday, the people said.

Regional Upheaval
It couldn't be determined which individuals were being considered as candidates for any transitional authority as talks continued late Thursday between the two leaders.

The support for mainstream opposition party leaders is unclear across the rugged and largely conservative country. Meanwhile, traditional tribal leaders who have great social standing would face problems exerting authority over rival tribes.

It was unclear whether the solution being hammered out with the president would meet the expectations of thousands of protesters, who have been camped on the streets of the capital for weeks demanding Mr. Saleh's immediate resignation. Various factions of protesters have issued manifestos demanding that a civilian council lead Yemen until new elections could be held. But their patience was wearing thin and opposition leaders said the risk of conflict grows higher as time elapses without a solution.

National demonstrations scheduled for after Friday prayers are increasing tensions. Such protests are expected in San'a, as well as the port city of Aden and Taiz, the country's traditional business and intellectual center.

Some protest leaders in the capital have been calling for a march Friday from the protest center in downtown's Change Square to the presidential palace, a move that diplomats and officials said would likely be viewed as a provocation to the remaining security forces who are loyal to the president and that could prompt more violence.

Yemeni opposition parties until recently had been fighting a lonely and frustrating battle for democracy after two years' of political dialogue with President Saleh ended at the end of last year with no change to the country's status quo, in which Mr. Saleh and his sons and nephews hold much military and political power.

Taking a cue from peaceful uprisings in other Arab nations, opposition political parties and youth activists have held continuous demonstrations in Yemen's capital for weeks. Their demands gained urgency, and support, in the wake of a crackdown last Friday in which plain-clothed security forces opened fire on unarmed demonstrators who had assembled in Change Square, killing at least 50 people.

Gen. Ahmar, a long-time close confidante of the president and the country's second-most powerful political figure, announced his support for the protesters, as did dozens of other military officers, tribal leaders and religious figures.

Mr. Saleh and Gen. Ahmar, who hail from the same tribe, have controlled Yemen for the last 32 years, steering it out of a civil war, the threat of domestic armed insurgents and al Qaeda networks. More recently, the men's relations turned frosty, according to diplomats. Mr. Saleh sees the general as a rival for power, and the president has sought to sideline the commander while advancing Mr. Saleh's eldest son as a possible successor, according to diplomats.

Earlier this week opposition forces deputized Gen. Ahmar to press their demands with the president, who until now has flatly refused to step down before next year.

Talks took a significant step forward early Thursday, when both men decided on a gentleman's agreement that they would resign from their posts simultaneously in favor of a civilian transitional authority to run the nation's affairs, the people familiar with the negotiations said.

The apparent breakthrough came after a marathon round of acrimonious telephone discussions, via aides, that started around 9 p.m. Wednesday between the president at his official residence and the general, who was at his home in downtown San'a, the people said.

The people said that President Saleh and Gen. Ahmar agreed to the central demand of the protest movement: that a civilian council should rule in place of Mr. Saleh, instead of an Egyptian-style military council.

By the start of the dawn prayer Thursday morning, the men hadn't worked out the structure or the composition of such an authority.

After a brief rest, discussions continued Thursday, after the two sides briefed the U.S. ambassador and the British ambassador to Yemen about their progress, according to the people familiar with the negotiations.

Further talks were expected Thursday night that included members of Yemen's opposition groups, the people said.

President Saleh, who has been in power since 1979, long has been viewed by the U.S. and Saudi Arabia as a bulwark against the possibility that Yemen would splinter and as a force that could hobble the influence of al Qaeda networks that have based themselves in Yemen and launched international terror attacks from the country.

The U.S. and the Saudis have watched with alarm in recent years as Yemen, under Mr. Saleh, has evolved into a failed state with shrinking oil revenue, an exploding population and conflicts with secessionists in the south, rebels in the north and an al Qaeda affiliate in rugged tribal regions. The U.S. has pushed the leader to enact democratic reform and has given tens of millions of dollars to elite counterterrorism units commanded by the president's eldest son and nephews.

Amid the current crisis, U.S. officials have worried that Yemen's security forces would be redeployed away from counterterrorism duties or that al Qaeda might take advantage of the crisis to launch new attacks.

In the strategically important southern province of Shebwa, where much of the nation's energy reserves are located, tribesmen have said they have taken over 17 military compounds belonging to Interior Ministry forces under the command of Mr. Saleh's nephew Yahya, a key liaison to U.S. counterterrorism officials. Tribes now control four of Shebwa's 17 districts and have taken over security duties as well as the responsibility to safeguard the energy infrastructure, according to tribesmen.

Write to Margaret Coker at margaret.coker@wsj.