Holding up the the first flag of the Baath Party regime, adopted by the Revolutionary Command Council, Syrians protest in the Shaar neighborhood of Aleppo during the funeral of a man allegedly killed in the bombardment of Sukari on July 27, 2012. The Obama administration is warning Syrian opposition forces not to completely disband President Bashar al-Assad’s hated government apparatus if he is killed. (PIERRE TORRES/AFP/GETTY IMAGES)

The Obama administration is warning Syrian opposition forces not to completely disband President Bashar al-Assad’s hated security and government apparatus if he is killed or forced from power, according to U.S. officials, who want them to avoid the chaos and power vacuum of Iraq in 2003.

Momentum has shifted rapidly against Assad, but the Syrian army fought back this weekend by launching an attack on Aleppo, the country’s largest city. After massing outside the city over the past few days, tanks backed by attack helicopters bombarded rebel-held neighborhoods on Saturday.

In increasingly detailed strategy sessions over recent weeks, U.S. officials have urged rebels and Syrian political opposition leaders to resist sectarian reprisals if Assad’s government falls. Officials said they are endeavoring to help the rebels learn from U.S. mistakes in Iraq, where the dissolution of the army and other institutions unleashed further turmoil.

“You can’t have a complete dissolution of that [system] because those institutions will be needed in a political transition,” said one U.S. official, who spoke on the condition of anonymity because discussions with Syria’s fragmented opposition are sensitive.

“What you need to prevent is the de-Baathification of the country,” the official said, referring to Assad’s ruling Arab nationalist movement. A Baath offshoot also ruled in Iraq under Saddam Hussein.

Underlying the widening discussion of post-Assad politics is growing confidence among U.S. officials that Assad cannot hold onto power much longer. Despite Assad’s vastly superior military position, U.S. officials point to recent rebel gains and defections to support their long-standing belief that Assad will be ousted or killed.

“We are confident that his days are numbered — that he is losing his grip on the country,” Michael Hammer, the assistant secretary of state for public affairs, told reporters this week. “Momentum is clearly against him.”

But many U.S. and Middle Eastern diplomats and intelligence analysts also think the regime still possesses sufficient resources to control Syria’s military and key cities for several more months, meaning violence is likely to worsen in the short term.

Syrian rebels have battled with government forces in and near the capital, Damascus, over the past week, resulting in some of the worst violence of the 16-month conflict, which has already killed 15,000 to 20,000 people, according to observer groups and activists.

Assad is digging in and is unlikely to surrender, said a Middle Eastern diplomat who closely tracks events in Syria.

“We’re seeing the rebels turn a corner,” said the diplomat, who insisted on anonymity in discussing his country’s internal assessments of events in Syria. “But the fact that his days are numbered are likely to make Assad even more hard-line than before. Now he will really lash out, and Iran is backing him with everything that it has.”

Analysts outside the government, including former U.S. officials, estimate that Assad could survive for months but not indefinitely.

The Obama administration’s warnings to rebel groups come amid a civil war that already has a strong sectarian stamp. A prolonged period of reprisal killings could follow the collapse of Assad’s security system, no matter what the United States or its opposition political contacts plan now.

Still, the administration has publicly urged Sunni-dominated opposition forces to respect minority rights in a post-Assad Syria, while generally avoiding public comparisons with Iraq. The cautionary tale of Iraq, including misplaced bets on opposition figures and the power vacuum that followed the toppling of Hussein in 2003, is a major reason President Obama has all but ruled out direct military help for the rebels.

Under advice from some of Hussein’s political opponents, the United States backed the de-Baathification policy that expelled even fairly low-level regime figures from government jobs. The policy hollowed out essential government ministries and lifted a lid on sectarian anger.

In Syria, Assad’s Shiite Alawite faction represents about 12 percent of the country’s approximately 22 million people but it controls most key government positions. Sunni Muslims are about 75 percent of the population, with Christians and other groups making up the remainder.

U.S. officials also urged conservatism in Egypt, including a period of military governance that rankled pro-democracy activists, but which the White House preferred to the lawlessness that might endanger Israel and which Washington might be called on to answer. The military and a democratically elected Muslim Brotherhood president are now at loggerheads in Egypt, and the country appears paralyzed. It is not clear how its leaders will confront the country’s staggering challenges, but U.S. officials say the homegrown democratic Egypt example is encouraging nonetheless.

Secretary of State Hillary Rodham Clinton has underscored the importance of political pluralism in a future free Syria, after several meetings with opposition figures outside the country.

Short of such warnings — and the implied threat that U.S. aid and political support hinge on good behavior — the Obama administration has not said how it would try to ensure even-handed treatment of Assad regime loyalists.

U.S. officials were encouraged by a statement from the Free Syrian Army rebel umbrella group this month pledging belief in “a free and democratic Syria in which all Syrian citizens live regardless of their ethnic, religious, and sectarian” identities.

U.S. caution about support for the rebels is based in part on evidence that some of the groups battling government forces are affiliated with al-Qaeda, or receive support from it.

Rising use of homemade bombs and suicide car bombs in Syria lend credence to that concern, and may suggest that the terrorist network’s influence is growing in Syria.

Figures obtained by The Washington Post show that the rate of attacks with makeshift bombs has increased fourfold over last year. A senior U.S. official said there have been an estimated 273 such incidents recorded between Dec. 1 and July 6, with Syrian police the most frequent target.

The increase was most dramatic in the use of suicide car bombs, a hallmark of Iraq’s branch of al-Qaeda.

“There is limited U.S. credible reporting in Syria, so there is a lot we do not know,” the official said. The official declined to talk about U.S. sources for the information, which are classified.

Nonetheless, the administration has gradually widened its embrace of the rebels, despite a lack of information about their backgrounds and agendas in a country largely defined by its ethnic and sectarian divisions.

The administration has explored ways to expand support short of arming the rebels, officials said. Some “non-lethal” aid supplied by the United States, such as communications equipment, can be used by rebels to coordinate and direct attacks with sophistication approaching that of the Syrian army.

The rebels are still badly out-gunned, however. Some Arab nations are funneling weapons to the rebels, but they do not have anything like the air power or aerial defenses of what some analysts say is second only to Israel as the best military in the Middle East.

To date, the United States has also supplied $64 million in humanitarian help inside Syria and for refugees in neighboring countries, said Tommy Vietor, White House National Security Council spokesman.

The administration is still struggling to develop a clear understanding of opposition forces inside the country, according to U.S. officials. U.S. spy agencies have expanded their efforts to gather intelligence on rebel forces and Assad’s regime in recent months, but they are largely confined to monitoring intercepted communications and observing the conflict from a distance, said officials who insisted on anonymity to discuss operations in Syria.

“Obama has been very reluctant, because he sees this as a slippery slope,” said Joshua Landis, director of the Center for Middle East Studies at the University of Oklahoma and a specialist on Syria. “Once you get in there and back a winner, you have to make sure that they win.”

Greg Jaffe contributed to this report.