Baghdad (CNN) Iraqi security forces have regained control of the area around the US Embassy in Baghdad after the compound was rocked by a second day of mass protests.

Earlier Wednesday security personnel fired tear gas and rubber bullets at hundreds of protesters -- some of whom were seen trying to climb the building's walls -- eyewitnesses told CNN.

Other witnesses said the protesters were hurling rocks, and trying to set fire to walls and security booths at the embassy's main entrance.

It was the second day of mass demonstrations outside the building in Baghdad's heavily fortified Green Zone, in response to US airstrikes on an Iranian-backed militia group on Sunday.

But by Wednesday evening, the protesters had cleared away from the embassy compound's entrance.

"We have issued the order for everyone to withdraw, because America should have received our message," said a spokesman for the main protest group, Kataib Hezbollah, which had been targeted by the US airstrikes.

Photos: US airstrike in Baghdad kills Iran's top general Mourners throng the car carrying the body of Iranian commander Qasem Soleimani during a funeral procession for Soleimani and Iraqi paramilitary leader Abu Mahdi al-Muhandis in Baghdad on January 4. Hide Caption 1 of 22 Photos: US airstrike in Baghdad kills Iran's top general Mourners touch a casket draped in Iranian flags during Qasem Soleimani's funeral procession on January 4. Hide Caption 2 of 22 Photos: US airstrike in Baghdad kills Iran's top general This photo, released by the Iraqi Prime Minister Press Office, shows a burning vehicle at the Baghdad International Airport following the US airstrike that killed Gen. Qasem Soleimani, the head of Iran's elite Quds Force, on January 3. Hide Caption 3 of 22 Photos: US airstrike in Baghdad kills Iran's top general People watch debris burn near the airport after the airstrike on January 3. Hide Caption 4 of 22 Photos: US airstrike in Baghdad kills Iran's top general Pro-Iranian militiamen and their supporters set a fire while US soldiers shoot tear gas during a demonstration outside the US Embassy in Baghdad, Iraq, on Wednesday, January 1. Hide Caption 5 of 22 Photos: US airstrike in Baghdad kills Iran's top general A protester inspects the burnt-out entrance of the US Embassy on January 1. Hide Caption 6 of 22 Photos: US airstrike in Baghdad kills Iran's top general US Marines stand guard on the roof of the US Embassy while protesters demonstrate on Wednesday. Hide Caption 7 of 22 Photos: US airstrike in Baghdad kills Iran's top general Protesters set fire to a reception room of the US Embassy in Baghdad, Iraq, on Tuesday, December 31. The embassy was attacked during demonstrations in response to recent airstrikes in Iraq and Syria conducted by US forces. Hide Caption 8 of 22 Photos: US airstrike in Baghdad kills Iran's top general US Marines from a crisis response task force based in Kuwait prepare to deploy to Baghdad to bolster security at the embassy. Hide Caption 9 of 22 Photos: US airstrike in Baghdad kills Iran's top general A US Army Apache helicopter drops flares over Baghdad in a show of force. Hide Caption 10 of 22 Photos: US airstrike in Baghdad kills Iran's top general Protesters carry the logo of the US Embassy. Hide Caption 11 of 22 Photos: US airstrike in Baghdad kills Iran's top general Smoke billows from a sentry box at an entrance of the embassy. Hide Caption 12 of 22 Photos: US airstrike in Baghdad kills Iran's top general Protesters throw stones toward the embassy. Hide Caption 13 of 22 Photos: US airstrike in Baghdad kills Iran's top general US soldiers take positions around the embassy during the protests. Hide Caption 14 of 22 Photos: US airstrike in Baghdad kills Iran's top general Protesters burn property in front of the embassy compound. Hide Caption 15 of 22 Photos: US airstrike in Baghdad kills Iran's top general People are seen through thick tear gas after protesters breached the outer wall of the embassy. Hide Caption 16 of 22 Photos: US airstrike in Baghdad kills Iran's top general A picture taken through a broken window shows a vandalized room in the embassy. Hide Caption 17 of 22 Photos: US airstrike in Baghdad kills Iran's top general US soldiers stand guard inside the embassy. Hide Caption 18 of 22 Photos: US airstrike in Baghdad kills Iran's top general Protesters and militia fighters smash the bullet-proof glass of the embassy's windows with blocks of cement after breaching the outer wall. Hide Caption 19 of 22 Photos: US airstrike in Baghdad kills Iran's top general Iraqi security forces stand guard as protesters, including clerics, hold a prayer inside the walls of the embassy. Hide Caption 20 of 22 Photos: US airstrike in Baghdad kills Iran's top general Iraqi security forces stand guard at the entrance of embassy. Hide Caption 21 of 22 Photos: US airstrike in Baghdad kills Iran's top general Mourners carry the coffins of Iranian-backed paramilitary fighters in Najaf, Iraq, on December 31. The fighters were killed in US airstrikes on Sunday that sparked Tuesday's attacks on the US Embassy in Baghdad. Hide Caption 22 of 22

The protests broke out after the US carried out airstrikes on five facilities in Iraq and Syria, which it said were linked to the Iranian-backed group, killing dozens of people.

US officials hold Kataib Hezbollah responsible for a growing number of rocket attacks against American facilities in Iraq.

The death of a US contractor in one such attack last week was the last straw for the Trump administration.

President Donald Trump blamed Iran for both the US contractor's death and Tuesday's attack on the US Embassy in Baghdad, and warned Iran's leaders they would be held responsible for any deaths or destruction at the embassy.

Protesters smash the bullet-proof glass of the US Embassy's windows in Baghdad on December 31.

"Iran will be held fully responsible for lives lost, or damage incurred, at any of our facilities," Trump tweeted. "They will pay a very BIG PRICE! This is not a Warning, it is a Threat."

But Iran's Supreme Leader Ayatollah Ali Khamenei responded by tweeting that the US "can't do anything."

"If you were logical -- which you're not -- you'd see that your crimes in Iraq, Afghanistan... have made nations hate you," Khamenei added.

Smoke rises from a reception room at the US Embassy in Baghdad after it was attacked by pro-Iranian militiamen and their supporters.

Eyewitnesses also told CNN that local law enforcement forces around the embassy had not been seen doing anything significant to stop the protestors demonstrating in front of the compound, or from throwing stones at it.

The airstrikes and ensuing protests come at a time of high tension between the US and Iran, and have stoked fears of a new proxy war in the Middle East

US sends extra forces to protect embassy

In the wake of Tuesday's attack on the US Embassy, Defense Secretary Mark Esper said the US would send approximately 750 soldiers to the Middle East.

"This deployment is an appropriate and precautionary action taken in response to increased threat levels against US personnel and facilities, such as we witnessed in Baghdad today," he said in a statement.

"The United States will protect our people and interests anywhere they are found around the world," Esper added.

Trump insisted in a tweet Tuesday that the embassy was safe. Secretary of State Mike Pompeo also told Fox News that there are currently no plans to evacuate the embassy or pull US troops out.

The weekend's airstrikes have strained relations between Washington and Baghdad. Iraqi officials accuse the US of attacking without sufficient evidence, of violating Iraqi sovereignty and of threatening the country's security.

US soldiers stand guard on the roof of the US Embassy in Baghdad while pro-Iranian militiamen and their supporters protest outside the building.

The militia targeted by US airstrikes

The Iranian-backed Kataib Hezbollah is militantly anti-American. In 2017 and 2018, its fighters in Syria tried to attack the US-supported garrison at al-Tanf on the Iraqi border.

It has provided hundreds of fighters for the Assad regime in Syria -- part of a broader Iranian effort to help stamp out the insurgency there -- and is an important element in Iranian efforts to extend its influence through northern Iraq and into Syria. The US strikes, notably, were against targets along the main route between Iran and Syria.

A spokesman for Kataib Hezbollah told CNN that the embassy protests were only a "first step."

"The American administration should understand the following: the first step was to protest near the American embassy, we are waiting their reactions to determine the second step," Mohamad Mouhiye said, calling for the US to shut down the embassy and withdraw from Iraq.

"First, close the doors of the evil embassy, which we consider a spy building and an operations room to administer and sabotage Iraq's well-being," Mouhiye said. "We also call on the US to withdraw their military forces which are in Iraq illegally."