BAGHDAD -- Tens of thousands of people, many of them young and unemployed men, thronged public squares and blocked main streets Friday in the capitals of Iraq and Lebanon in unprecedented, spontaneous anti-government revolts in two countries scarred by long conflicts.

Demonstrators in Iraq were beaten back by police firing live ammunition and tear gas, and officials said 30 people were killed in a fresh wave of unrest that has left 179 civilians dead this month. In Lebanon, scuffles between rival political groups broke out at a protest camp, threatening to undermine an otherwise united civil disobedience campaign now in its ninth day.

The protests are directed at a postwar political system and a class of elite leaders that have kept both countries from relapsing into civil war but achieved little else. The most common rallying cry from the protesters in Iraq and Lebanon is "Thieves! Thieves!" -- a reference to officials they accuse of stealing their money and amassing wealth for decades.

The leaderless uprisings are unprecedented in uniting people against political leaders from their own religious communities. But the revolutionary change they are calling for would dismantle power-sharing governments that have largely contained sectarian animosities and force out leaders who are close to Iran and its heavily armed local allies.

Their grievances are not new.

Three decades after the end of Lebanon's civil war and 16 years after the U.S.-led invasion of Iraq, the streets of their capitals echo with the roar of private generators that keep the lights on. Tap water is undrinkable and trash goes uncollected. High unemployment forces the young to put off marriage and children.

Every few years there are elections, and every time it seems like the same people win.

The sectarian power-sharing arrangement that ended Lebanon's 1975-1990 civil war distributed power and high offices among Christians, Shiites and Sunnis. It has mostly kept the peace, but has turned former warlords into a permanent political class that trades favours for votes. A planned tax on WhatsApp amid a financial crisis was the last straw.

In Iraq, a similar arrangement among Shiites and minority Sunnis and Kurds has led to the same corrupt stasis, with parties haggling over ministries so they can give jobs and aid to supporters while lining their own pockets. The devastating war against the Islamic State group only exacerbated decades-old economic problems in the oil-rich country.

"They (leaders) have eaten away at the country like cancer," said Abu Ali al-Majidi, 55, pointing toward the Green Zone, home to government offices and Western embassies.

"They are all corrupt thieves," he added, surrounded by his four sons who had come along for the protest.

In Iraq, a ferocious crackdown on protests that began Oct. 1 resulted in the deaths of 149 civilians in less than a week, most of them shot in the head and chest, along with eight security forces killed. After a three-week hiatus, the protests resumed Friday, with 30 people killed, according to the semi-official Iraq High Commission for Human Rights.

In both countries, which share a history of civil strife, the potential for sustained turmoil is real.

Iraq and Lebanon are considered to be firmly in Iran's orbit, and Tehran is loath to see protracted political turbulence that threatens the status quo, fearing it may lose influence at a time when it is under heavy pressure from the U.S.

The Iran-backed Hezbollah in Beirut and the Popular Mobilization Forces in Baghdad have said they want the governments in both countries to stay in power.

The protests against Iraq's Shiite-led government have spread to several, mainly Shiite-populated southern provinces. In Lebanon, demonstrations have erupted in Shiite communities, including in south Lebanon for the first time.

Signs of a backlash against Tehran's tight grip on both countries can already be seen.

Among the protesters' chants in Baghdad, one said: "Iran out, out! Baghdad free, free!"

Protesters trying to reach the heavily fortified Green Zone were met with tear gas and live ammunition. Men in black plainclothes and masks stood in front of Iraqi soldiers, facing off with protesters and firing the tear gas. Residents said they did not know who they were, with some speculating they were Iranians.

In the south, headquarters of Iran-backed militias were set on fire.

In central Beirut, Hezbollah supporters clashed with anti-government protesters. Supporters of the powerful group rejected the protesters equating its leader with other corrupt politicians. A popular refrain in the rallies, now in their ninth day, has been: "All means all."

Hezbollah leader Hassan Nasrallah warned in a televised speech that the protests -- although largely peaceful until now -- could lead to chaos and civil war. He said they were being hijacked by political rivals opposing the group.

"We are closing the roads, calling for toppling the system that has been ruling us for the past 30 years with oppression, suppression and terror, said Abed Doughan, a protester blocking a street in southern Beirut.

After Friday's deadly violence in Iraq, a curfew was announced in several areas of the south. Hundreds of people were taken to hospitals, many with shortness of breath from the tear gas.

The current round of protests has been endorsed by nationalist Shiite cleric Muqtada al-Sadr, who has a popular base of support and holds the largest number of seats in parliament. He has called on the government to resign and suspended his bloc's participation in the government until it comes up with a reform program.

However, powerful Shiite militias backed by Iran have stood by the government and suggested the demonstrations were an outside "conspiracy."

Iraq's most senior Shiite spiritual leader, Grand Ayatollah Ali al-Sistani, appealed for protesters and security forces to avoid violence. In his Friday sermon, he also criticized the government-appointed committee investigating the crackdown in the previous protests, saying it did not achieve its goals or uncover who was behind the violence.

As in the protests earlier this month, the protesters, organized on social media, started from the central Tahrir Square. The demonstrators carried Iraqi flags and chanted anti-government slogans, demanding jobs and better public services like water and electricity.

"I want my country back, I want Iraq back," said Ban Soumaydai, 50, an Education Ministry employee who wore black jeans, a white T-shirt and carried an Iraqi flag with the hashtag 'We want a country' printed on it.

Prime Minister Adel Abdul-Mahdi has struggled to deal with the protests. In an address to the nation early Friday, he promised a government reshuffle next week and pledged reforms. He told protesters they have a right to peaceful demonstrations and called on security forces to protect the protesters.

Similarly, Lebanese Prime Minister Saad Hariri issued an emergency reform package few days after the protests began on Oct. 17 -- a document that has been dismissed by protesters as "empty promises."

------

Karam reported from Beirut and Krauss from Jerusalem. Associated Press writer Sarah El Deeb in Beirut contributed.