BEIRUT -- Lebanon's prime minister resigned Tuesday, bowing to one of the central demands of anti-government demonstrators shortly after baton-wielding Hezbollah supporters rampaged through the main protest camp in Beirut, torching tents, smashing plastic chairs and chasing away protesters.

The demonstrators later returned to the camp in time to hear the news that Prime Minister Saad Hariri said he was stepping down after hitting a "dead end" in trying to resolve the crisis, which has paralyzed the country for nearly two weeks. The protesters erupted in cheers at the news.

The resignation plunges Lebanon deeper into turmoil and uncertainty as it grapples with a severe economic and financial crisis that has led to a scarcity of hard currency and the local currency losing value for the first time in more than two decades. Lebanon is facing a deep-running fiscal crisis as it staggers under one of the highest debt ratios in the world — $86 billion, or more than 150% of the country's gross domestic product.

The rampage by supporters of Hezbollah and Parliament Speaker Nabih Berri's Shiite Amal movement marked a violent turning point in the protests, which have called for the resignation of the government and the overthrow of the political class that has dominated the country since the 1975-1990 civil war and is blamed for the current economic crisis. The government is dominated by factions allied with Hezbollah, the most powerful armed group in the country.

Hariri had reluctantly worked with those factions as part of a national unity government that had failed to address an increasingly severe economic and fiscal crisis.

"I tried all this time to find an exit and listen to the voice of the people and protect the country from the security and economic dangers," Hariri said. "Today, to be honest with you, I have hit a dead end, and it is time for a big shock to confront the crisis."

Hariri's resignation fulfills a key demand of the protesters but plunges the country into even greater uncertainty, with no clear path toward the fundamental political change they are demanding. The economy, which was in the grip of a major fiscal crisis even before the protests began, is now at risk of collapsing, with banks, schools and many businesses having been closed for two weeks.

A proposed tax on the WhatsApp messenger service ignited protests Oct. 17, sending hundreds of thousands of people into the streets in the largest demonstrations in more than a decade. The protests soon widened into calls for the overthrow of the political elites who have ruled the country since the 1975-1990 civil war.

Similar demonstrations erupted in Iraq this month, calling for the overthrow of the political class that became entrenched after the 2003 U.S.-led invasion. The protests there have been much more violent, with security forces firing tear gas and live fire. At least 240 people have been killed.

Lebanon's protests were largely peaceful, with only occasional minor scuffles with security forces, but that changed early Tuesday, when groups of men began confronting protesters who were blocking roads.

The men initially presented themselves as disgruntled residents frustrated by the country's paralysis, but they later could be heard chanting, "At your service, Hussein," a Shiite religious slogan, and "God, Nasrallah, and the whole Dahiyeh," referring to Hezbollah leader Hassan Nasrallah and the group's stronghold in the southern suburbs of Beirut.

They launched their attack about midday on the main protest camp in Beirut where demonstrators have been staying for nearly two weeks. The rallies swell at night, but there were only a few dozen protesters in the square when the Hezbollah supporters arrived.

Soldiers and riot police initially moved in to separate the groups but were unable to prevent the Hezbollah supporters from storming Martyrs' Square in central Beirut, the main protest site. Hezbollah supporters lashed out at reporters covering the melee, kicking some of them and reaching for their cameras.

It was unclear how many people were wounded. Fights broke out in places and security forces could be seen beating some people with batons.

The protesters armed themselves with wooden batons and metal poles as the Hezbollah supporters approached but fled when the counterdemonstrators arrived in larger numbers. Security forces later fired tear gas to disperse them, but only after they had destroyed and set fire to several tents.

Nasrallah had criticized the protests last week, accusing unspecified foreign powers of exploiting them to undermine his group and saying they threatened to drag the country into civil war.

Hezbollah was the only armed group in Lebanon to maintain its weapons after the civil war, saying they were needed to defend the country from Israel, which occupied parts of southern Lebanon from 1982 until 2000. Hezbollah later fought Israel to a stalemate during a ferocious monthlong war in 2006.

Hezbollah is widely seen as being more militarily powerful than even the Lebanese armed forces.

It was not clear if Hezbollah directly ordered Tuesday's attack, but the group has not disavowed the behavior of its supporters. It was an ominous sign, raising the possibility that one or more of Lebanon's many sectarian factions could resort to violence as the crisis deepens.

U.N. Secretary-General Antonio Guterres urged all sides to avoid violence and for security forces to show restraint, saying he hoped for a political solution that would "preserve stability and peace," his spokesman said.

"We're fully opposed and strongly opposed to all attacks that impede the peaceful protests that are underway," said the spokesman, Farhan Haq.

U.S. Secretary of State Mike Pompeo called on "Lebanon's political leaders to urgently facilitate the formation of a new government that can build a stable, prosperous, and secure Lebanon that is responsive to the needs of its citizens."

"The peaceful demonstrations and expressions of national unity over the last 13 days have sent a clear message. The Lebanese people want an efficient and effective government, economic reform, and an end to endemic corruption," Pompeo said in a statement.

Groups of protesters eventually returned to the main squares and began repairing their tents, while others went back to blocking the roads. They could be heard chanting one of the main slogans of the protests, "All means all," which is seen as referring to all of Lebanon's political factions, including Hezbollah and its allies.

The protesters welcomed Hariri's resignation, but it's unclear what comes next. He could stay in office as a caretaker prime minister, with the pro-Iran factions strengthened.

Lebanon has gone through long periods of paralysis before. A complex power-sharing arrangement distributes power and high offices among Shiites, Sunnis and Christians. That has prevented the country from sliding back into civil war but has spawned networks of patronage and nepotism, and has made it virtually impossible for the government to take major decisions or even provide reliable public services.

The protesters have called for sweeping change to the political system that would produce non-sectarian governments capable of addressing the country's many challenges.

———

Associated Press writers Sarah El Deeb and Joseph Krauss contributed.