Yemeni anti-government protesters chant slogans demanding the resignation of Yemeni President Ali Abdullah Saleh in Sanaa on March 22, 2011 as the embattled leader warned that a coup attempt could spark civil war. (AHMAD GHARABLI/AFP/GETTY IMAGES)

Yemeni President Ali Abdullah Saleh clung to power by a thread Tuesday, after the country’s most powerful military commander defected to the opposition and scores of government officials, diplomats and other senior army figures resigned their posts.

In a meeting with senior government, military and tribal leaders Monday evening, Saleh offered to step down by the end of this year, news agencies reported. He previously had pledged not to run for reelection and to leave office when his term ends in September 2013. But the new concession failed to pacify anti-Saleh protesters, who pressed demands that he step down immediately.

“We reject Saleh’s offer to step down, and we tell him that the next couple of hours will be decisive for his regime,” opposition spokesman Mohammed Qahtan said.

Issuing a televised warning to a meeting of his Supreme Council of the Armed Forces on Tuesday, Saleh rejected the opposition’s demand and raised the specter of civil war.

Saleh took refuge inside the presidential palace while those outside — including in Washington — debated anxiously whether he would make a last stand with troops who remain loyal, be overwhelmed by the forces arrayed against him or “face the inevitable” and resign, a senior Obama administration official said.

Asked on Tuesday if the United States still supported Saleh, Defense Secretary Robert M. Gates declined to give a direct answer.

“I don’t think it’s my place to talk about internal affairs in Yemen,” Gates told reporters traveling with him in Moscow. “We are obviously concerned about the instability in Yemen. We consider al-Qaeda in the Arabian Peninsula, which is largely located in Yemen, to be perhaps the most dangerous of all the franchises of al-Qaeda right now. So instability and diversion of attention from dealing with AQAP is certainly my primary concern about the situation.”

Al-Qaeda in the Arabian Peninsula is an offshoot of the Osama bin Laden group that U.S. officials said last year was the most urgent threat to the United States.

In his televised speech Tuesday, Saleh warned army commanders against attempting to overthrow him, saying this would lead to civil war. “Those who want to reach power through coups should know what they are seeking is impossible,” he said. In that event, he declared, Yemen would not be stable because a bloody civil war would be inevitable.

Saleh vowed that he would not hand power to those who had joined the opposition.

Earlier Tuesday, Maj. Gen. Ali Mohsen al-Ahmar, the commander of Yemen’s northwestern military district who defected Monday, called on Saleh to step down to save the country from disaster.

In the northern part of the country, meanwhile, at least seven people were reported killed and 13 wounded in clashes between Shiite Houthi rebels and pro-government tribes.

The United States and Saudi Arabia, whose governments consider Saleh a key counterterrorism ally and are his main economic and political backers, appeared to be little more than bystanders in the tense drama playing out on the streets of Sanaa, the Yemeni capital.

As night fell Monday and opposing military forces, including tanks and artillery, took up positions around the city, the administration official said it was a “miracle” that Saleh had survived the day.

Another U.S. official, one of several who agreed to discuss the situation in Yemen only on the condition of anonymity, said that the administration would not “speculate or try to predict the outcome.”

In exchange for Saleh’s cooperation against al-Qaeda in the Arabian Peninsula, the United States has significantly increased its military and economic assistance to Yemen, including the deployment of Special Forces and intelligence personnel and armed Predator drones.

The upheaval on Monday followed the killings of more than 50 people Friday when government snipers fired at them from rooftops during a protest, one of many that have taken place in recent weeks. In a statement to demonstrators, Mohsen, the leading defector, condemned government repression and announced his “support for the peaceful revolution.”

“The military are the protectors of the people,” he told al-Jazeera television. “I here announce that my forces will join the revolution and will protect the youth” gathered in the center of Sanaa, the capital.

Adding to the blow, Sadeq al-Ahmar, considered Yemen’s most powerful tribal leader, appealed to Saleh to step down while it is still possible.

The Friday shootings appeared to have been the tipping point for many. “It was as if [Saleh] were digging his own grave,” Jamila Ali Rajaa, a former adviser to the Foreign Ministry, said in a telephone interview. The president was “leaving, one way or the other,” she said after quitting her position Monday.

“Developments are moving really fast,” said Mohammed A. Abulahoum, a longtime senior adviser to the government on foreign policy and economic issues who broke with Saleh several weeks ago. “It’s been going on for 40 days, but the serious moves took place today,” said Abulahoum, who spoke by telephone from Sanaa.

“The best thing that could happen here is if we have a good exit strategy” for Saleh, he said.

Amid competing rumors and what the White House called a “fluid” situation, there were reports that Mohsen was discussing an arrangement with Saleh in which the president would accept substantial government changes and agree to leave office at the end of the year. A senior opposition leader said another option under discussion was for Saleh to step down and a military council to run the country until elections could be held.

Any compromise that would leave Saleh in power was unlikely to be accepted by the largely youthful protesters. Beneath their jubilation over Mohsen’s breaking ranks with the government was an undercurrent of anxiety about a possible new eruption of violence or a political deal would prevent the wholesale change they seek and leave traditional power brokers and a repressive system in control.

Mohsen, who commands one of Yemen’s four military districts, is a longtime ally of Saleh’s and assisted him in suppressing past challenges to his power. A 2005 classified cable from the U.S. Embassy in Sanaa, released by WikiLeaks, described him as “the most powerful” of the country’s military elite and a leading contender for power if Saleh should fall.

The cable cautioned that his “questionable dealings with terrorists and extremists, however, would . . . [be] unwelcome to the U.S.” More recently, the senior administration official said, Mohsen was considered “a mixed bag. We talk to him . . . like so many Yemenis.”

“So much depends on when Saleh leaves, how he leaves, whether it’s a peaceful handing over of power to someone or something much more violent,” said Gregory Johnsen, a Yemen expert based at Princeton University. “The truth is, no one really knows.”

Saleh’s fall, after 32 years in power, would make him the third long-standing government leader, after presidents in Tunisia and Egypt, to be driven from power by the wave of popular protest sweeping the Middle East and North Africa.

Yemen has been added to the regular crisis briefings that President Obama is receiving on Libya and Japan, Benjamin J. Rhodes, deputy national security adviser, told reporters traveling with White House officials in South America. On Friday, Obama deplored the shootings and called for political change “that meets the aspirations of the Yemeni people.”

On Sunday, after Saleh had dismissed his cabinet and declared a 30-day state of emergency, John O. Brennan, Obama’s chief counterterrorism adviser and the president’s point man for dealings with Yemen, telephoned him to reiterate U.S. views.

All U.S. citizens in Yemen were advised to stay indoors, and the State Department has authorized the voluntary departure of some personnel. At least 100, and perhaps significantly more, U.S. military personnel are based in Yemen, where they collect intelligence on al-Qaeda-related insurgents and train Yemeni counterterrorism forces.

The military defections, which included five generals in addition to Mohsen and reportedly dozens of other officers, were seen by U.S. intelligence analysts as the most compelling evidence yet that Saleh’s grip on power is slipping.

“The recent killings of protesters in Sanaa didn’t help Saleh’s standing within his own government and military,” said a U.S. official familiar with access to classified reports on the country. But, he said, “it’s too soon to say exactly how things will play out.”

At least some of Yemen’s military appeared to continue to support Saleh, although opposition leaders said they expected more defections. Defense Minister Mohammed Nasser Ahmed said on television that the armed forces remained loyal to the president and would counter any plots against “constitutional legitimacy” and “democracy.” He spoke after a meeting of the National Defense Council, which is led by Saleh.

At least a dozen tanks and armored personnel carriers belonging to the Republican Guards, an elite force led by Saleh’s son and one-time heir apparent, Ahmed, were deployed outside the presidential palace on Sanaa’s southern outskirts.

Saleh also sent a message via his foreign minister to King Abdullah of Saudi Arabia, Yemen’s powerful neighbor and an on-and-off backer of the Yemeni leader.

“What both Riyadh and Washington are saying right now is very, very important,” said Johnsen, the Princeton expert. With turmoil in Bahrain to the east and Egypt to the west, “the Saudis are concerned over seeing any more governments fall . . . but, at the same time, they don’t want to see chaos in Yemen.” The current Saudi position, Johnsen said, is unclear, with “a number of different princes trying to make policy.”

Among the Yemeni diplomats who resigned Monday, according to a list compiled by al-Jazeera, were ambassadors to at least 10 Middle East countries, as well as Germany, Spain, Belgium, Pakistan and the United Nations.

Special correspondent Hakim Almasmari in Sanaa, Yemen, and staff writers Craig Whitlock in Moscow and William Branigin and Greg Miller in Washington contributed to this report.