Iraqis who lived through the U.S.-led invasion that toppled Saddam Hussein see eerie similarities in the scenes of Libyans parading through Tripoli ripping up posters of Moammar Gadhafi. But Iraqis also saw looting, bloodshed and bombings in the days and years since.
"A lot of people think that freedom means doing whatever you want to do," said Saad Abbas, who witnessed the jubilant cheering when a statue of Saddam Hussein was torn down by American troops steps from Baghdad's Palestine Hotel.
Libyans "are going to have revenge, stealing from the shops. A lot of problems will happen," Abbas said in an interview at the hotel, which he manages.
Skirmishing, some intense, continues in Tripoli. But Gadhafi's regime seems all but finished, with his leading opponents who had established their interim administration, the National Transitional Council, in eastern Libya earlier now moving into Tripoli.
The Iraq conflict provides a sober lesson: Winning the peace is often harder than winning the war.
Libya's rebel military chief Abdel-Hakim Belhaj seems aware of the challenge, telling Al-Jazeera television Tuesday: "We ask God to bless our country with stability."
Belhaj also called on Libyans to act responsibly.
"We need security for our people, justice and prosperity," he said.
There are of course key differences between Iraq eight years ago and Libya today. Although Libyan rebels have had NATO support, the battle to overthrow Gadhafi was an internal uprising galvanized by domestic dissent and propelled by Libyan ground forces. The presence of U.S. troops on Iraqi soil almost immediately became a rallying cry for both Sunni resistance groups and later Shiite militant groups, said Jabir Habib, professor of political science at Baghdad University.
The lessons of Iraq, as well as Afghanistan, were on the minds of many in the West who feared another drawn-out conflict should the U.S. or NATO send troops into Libya.
Libya's neighborhood also differs from Iraq's. Tunisia and Egypt, on Libya's borders, are themselves going through democratic transitions that can serve as a model for Libya.
Iraq, nestled between Sunni powerhouse Saudi Arabia and Shiite dominated Iran, essentially became a battleground for the two meddling neighbors, said Michael Hanna of The Century Foundation .
Libya does not have the stark sectarian and religious differences that drove violence to such horrific levels in Iraq. But Libya does have tribal divisions that could prove deadly if those with ties to Gadhafi feel excluded.
In Libya now, the short-term challenge is securing the capital. The undermanned American forces, with little plan for securing the country, never did that in Iraq, where the National Museum was among the sites looted.
Paul Bremer, the head of the American-backed Coalition Provisional Authority who essentially ruled Iraq during the first year of Saddam's ouster, disbanded the Iraqi Army, leading to tens of thousands of angry Iraqis on the streets and fueling the insurgency.
Hanna of The Century Foundation said the rebels' governmental body, the National Transitional Council, has been eager to show that it is securing Tripoli.
"The security vacuum that opened up right after the fall of Baghdad and the looting, that was seared into people's minds," he said.
The long-term challenges may be tougher. The building blocks of democracy and freedom _ parliaments, parties and credible elections _ won't just fall into place.
Habib said Libya should move faster than Iraq on important issues. Iraq's first elections weren't held until January 2005, nearly two years after the invasion, and the constitution wasn't approved by voters until October 2005 when Iraq was almost into full-scale civil war.
Iraq also set an early policy of revenge and not reconciliation. Under a process called de-Baathification started by the Coalition Provisional Authority, Iraqis with ties to Saddam's ruling Baath Party lost their jobs.
"Many of the qualified or good people, some of them were the wealth of Iraq, were excluded from their positions," said Iraqi human rights activist Hana Adwar. "If Libyans do this, I fear that will be chaos for the state."
Mahmoud Jibril, the head of Libya's opposition government, told reporters in Paris on Wednesday that his plan for the transition to democracy started with the formation of a national congress to which all Libyan cities would send delegates, and which would select a committee to write a constitution. He said parliamentary elections would follow the constitution within four months, and the parliament speaker will be the interim president. Next will be presidential elections.
Already in Libya, former Gadhafi loyalists have taken key roles in the opposition. Jibril promised "no more alienation."
What may be the most lasting lesson of the Iraq conflict is how difficult it is to maintain unity once the celebrations over a dictator's ouster are gone. Right now, Libyan rebels are united in their desire to oust Gadhafi and his regime. But so were Iraqi leaders and now the government is beset by infighting.
"They were together because their enemy was one: Saddam and the Baathists," said Abbas. "Over there in Libya, they have one enemy: Gadhafi and his family, his tribe. When they leave, the differences between them will appear."
Associated Press writer Qassim Abdul-Zahra contributed to this report.