SANAA, Yemen -- Yemen's U.S.-backed president, his support crumbling among political allies and the army, warned that the country could slide into a "bloody" civil war Tuesday as the opposition rejected his offer to step down by the end of the year. Tens of thousands protested in the capital demanding his immediate ouster, emboldened by top military commanders who joined their cause.

Ali Abdullah Saleh's apparent determination to cling to power raised fears that Yemen could be pushed into even greater instability. In a potentially explosive split, rival factions of the military have deployed tanks in the capital Sanaa -- with units commanded by Saleh's son protecting the president's palace, and units loyal to a top dissident commander protecting the protesters.

The defection on Monday of that commander, Maj. Gen. Ali Mohsen al-Ahmar, a powerful regime insider who commands the army's 1st Armored Division, has been seen by many as a major turning point toward a potentially rapid end for Saleh's nearly 32-year rule.

The question is whether the Yemeni chapter of the uprisings sweeping the Middle East will read more like Egypt -- where the resignation of President Hosni Mubarak set the country on a relatively stable, if still uncertain, move toward democracy -- or like Libya, which has seen brutal fighting between armed camps.

Already, clashes broke out late Monday between Saleh's Republican Guard and dissident army units in the far eastern corner of the country. On Tuesday, Republican Guard tanks surrounded a key air base in the western Red Sea coastal city of Hodeida after its commander -- Col. Ahmed al-Sanhani, a member of Saleh's own clan -- announced he was joining the opposition.

The turmoil raised alarm in Washington, which has heavily backed Saleh to wage a campaign against a major Yemen-based Al Qaeda wing that plotted attacks in the United States.

U.S. Defense Secretary Robert Gates, on a trip to Russia, said Tuesday that "instability and diversion of attention" from dealing with Al Qaeda is a "primary concern about the situation." He refused to weigh in on whether Saleh should step down.

After a month of street protests -- led mainly by students and pro-democracy advocates -- against his nearly 32-year rule, Saleh became dramatically more isolated after security forces opened fatally shot more than 40 demonstrators on Friday.

The killings set off an avalanche of defections by top figures in his ruling party, influential tribal leaders and, most damagingly, al-Ahmar and a string of other top generals.

In a meeting Tuesday with his still-loyalist military commanders, Saleh railed against the dissidents, calling them "weak" and saying they "dropped away like autumn leaves."

"Those who want to climb to power through a coup should know that things won't stabilize. The nation won't be stable, it will turn into a civil war, to a bloody war, so they should think carefully," he said.

At the same time, he issued a softer statement, saying he "sympathizes with the youth" and calling on protesters to enter a dialogue. He said he believed their movement could "renew the democratic energy" in the country."

Monday night, Saleh pledged in a meeting with senior officials, military commanders and tribal leaders that he would step down by the end of the year, according to a presidential spokesman, Ahmed al-Sufi. Saleh had earlier rejected such a proposal, making a more limited concession of promising not to run for re-election when his term ends in 2013.

But the opposition said the new offer was too little, too late.

"The president's statements are just another political maneuver," said chief opposition spokesman Mohammed al-Sabri. "What was acceptable yesterday is not acceptable for us today."

"There is only one option, that the president announces his resignation and hands over power. Only then can we meet with the president to agree on transferring power," he said.

In Washington, State Department spokesman Mark Toner said Saleh's resignation at year-end would be positive "if this is something that many people respond to and it meets their aspirations."

"What we're looking for is dialogue that leads to a peaceful solution," Toner told reporters.

Protesters massed by the tens of thousands Tuesday afternoon in the downtown Sanaa plaza they have dubbed "Taghyeer," or "Change" square. Crowds ululated, chanted and painted each other's faces in the red, white and black colors of the national flag. Conservative tribesmen bought their wives to the protest, and the women bought their children, all basking in a carnival atmosphere.

The wave of defections and resignations since Friday have included army commanders, ambassadors, members of Saleh's ruling party, lawmakers, provincial governors and some managers of the state-run media. With most pillars of his rule knocked away, Saleh's strongest card remains his family and the loyalist military units they command.

Throughout his rule, Saleh has stayed in power through manipulation and patronage. He has used money to keep the loyalty of powerful tribes, seeded the military with close family members and courted Islamic fundamentalists, using militants as pro-regime fighters against opponents.

Even while his hold on power in Sanaa seemed entrenched, the deeply impoverished nation has been crumbling around him for several years. A powerful secessionist movement has torn apart the south, which was once an independent nation. In the north, Shiite rebels rose up against his military. In many parts of the mountainous nation, which has little infrastructure, discontented tribes all but shook off his authority.

The defections, however, throw the protest movement into the thick of Yemen's deeply complicated politics. The new factions joining in are hardly a unified force.Al-Ahmar is mistrusted by some. He had a complex relationship with Saleh, seen as both a key ally and a potential rival.

He also has close ties to Yemen's Salafis, an ultraconservative Islamic movement that in some ways mirrors Al Qaeda's ideology. Yemen's most influential Salafi, Sheik Abdul-Majid al-Zindani, already announced his support for the protesters.

Al-Ahmar is also unpopular in the south, where secessionists have largely backed the protests against Saleh. Al-Ahmar is a veteran of the 1994 civil war that saw Saleh's army suppress an attempt by southern Yemen to secede.

Some protesters expressed fears their movement, which has focused on establishing democratic rule, could be hijacked.

"There are worries, especially after some extremist Salafi and military elements joined," said Bushra al-Maqtari, a leading activist among the protesters. "But we are watchful ... We don't refuse anyone who supports the revolutionaries, even those once linked to the regime. But we are all in agreement that they don't have the right to speak in the name of the revolution."

Also joining the protesters have been top figures from Yemen's most powerful tribe, the Hashid, to which Saleh himself and al-Ahmar belong. Among them are the tribe's leader Sheik Sadeq al-Ahmar and his brothers -- Hamid, an influential businessman who has long been a critic of the president, and Himyar, formerly the deputy parliament speaker.

Sheik Sadeq spoke to protesters in Change Square on Tuesday, trying to reassure them. "Don't be afraid or listen to rumors that say that the tribes or military will hijack the revolution," he said.

"We are with you. We will support your demands. We will not be an alternative. Don't listen to rumors."

But the Hashid support also raised worries the tribe is seeking to maintain its status by backing Ali Mohsen al-Ahmar as a successor to Saleh.

A top American concern is that Al Qaeda or other Islamic militants could fill any power vacuum

Several hundred Al Qaeda militants are believed to be operating in the country, taking refuge in remote areas.

Late Tuesday, Yemen's Interior Ministry said in a statement that 12 Al Qaeda fighters had been killed in clashes with the army in the town of Lawder in the southern province of Abyan.

The country has a strong Islamic radical movement, not directly belonging to Al Qaeda, including thousands of veterans of "jihad" in other countries.

Ironically, those radicals could also be a card in Saleh's hand. In the south in particular, his regime has used militants to put down seccessionists.

For the past two days, armed Islamic militants have been on a rampage in the southern city of Aden, breaking into nightclubs, throwing out patrons and setting fire to buildings. They spraypainted graffiti on buildings around the city, reading "The people want the rule of God."