Updated

The siege outside of the U.S. Embassy in Baghdad came to an end Wednesday afternoon after dozens of pro-Iran militiamen and their supporters withdrew from the compound.

The two-day crisis started early Tuesday, when, in an orchestrated assault, hundreds of protesters stormed the embassy compound, one of the most heavily fortified U.S. diplomatic missions in the world.

As the militiamen cleared the area, smoke still rose from a section of the compound building where hours before they had lit a fire on the roof.

U.S. troops fired tear gas on Wednesday to disperse pro-Iran protesters who were gathered outside the U.S. Embassy compound in Baghdad for a second day as dozens of pro-Iranian militiamen and their supporters had camped out at the gates of the embassy in Baghdad, where they stayed the night. (AP Photo/Khalid Mohammed)

U.S. troops fired tear gas on Wednesday to disperse pro-Iran protesters who were gathered outside the U.S. Embassy compound in Baghdad for a second day as dozens of pro-Iranian militiamen and their supporters had camped out at the gates of the embassy in Baghdad, where they stayed the night. (AP Photo/Khalid Mohammed)

The violent protests, which included smashed windows and sprayed graffiti on the embassy's walls, were said to be in protest of the deadly U.S. airstrikes that targeted an Iran-backed militia over the weekend, killing 25 fighters. In turn, those strikes had been in response to a rocket attack on an Iraqi Army base that killed a U.S. contractor and injured several American troops.

The protests prompted the Pentagon to send hundreds of additional troops to the Middle East.

TRUMP VOWS IRAQ 'WILL NOT BE A BENGHAZI' AFTER IRAN-BACKED EMBASSY RAID

Earlier Wednesday morning, the protesters had set up around 50 tents, along with a makeshift clinic. Cooks with aprons were serving meals out of giant pots.

Outside one of the gates, a Shiite cleric recited verses from the Muslim holy book, the Koran, through a loudspeaker.

Pro-Iranian militiamen and their supporters set a fire during a sit-in in front of the U.S. embassy in Baghdad, Iraq, Wednesday, Jan. 1, 2020. (AP Photo/Khalid Mohammed)

Pro-Iranian militiamen and their supporters set a fire during a sit-in in front of the U.S. embassy in Baghdad, Iraq, Wednesday, Jan. 1, 2020. (AP Photo/Khalid Mohammed)

Elsewhere, demonstrators could be seen hurling rocks over the walls of the embassy compound before U.S. troops responded by firing tear gas from the roofs of the buildings.

The Popular Mobilization Forces, an umbrella group of state-allied militias — many backed by Iran — called on its supporters to withdraw in response to an appeal by the Iraqi government, saying “your message has been received.”

By late afternoon the tents had been taken down and the protesters relocated to the opposite side of the Tigris River, outside the so-called Green Zone housing government offices and foreign embassies. U.S. Apache helicopters circled overhead.

"After achieving the intended aim, we pulled out from this place triumphantly," said Fadhil al-Gezzi, a militia supporter, told the Associated Press. “We rubbed America's nose in the dirt.”

NY TIMES TWEET ON 'IRQAI MOURNERS' STORMING BAGHDAD EMBASSY PROMPTS BACKLASH ONLINE

Some 100 U.S. Marines arrived at the embassy late Tuesday to bolster security as President Trump has denounced the actions by protesters, vowing the situation in Baghdad “will not be a Benghazi.”

On Sept. 11, 2012, the American diplomatic compound in Benghazi, Libya, was attacked by members of an Islamic militant group. Four Americans were killed in the attack, which lasted two days. U.S. Ambassador to Libya Chris Stevens was among those killed.

“It’s been handled very well,” the president told reporters as he walked into a New Year’s Eve celebration at his Mar-a-Lago resort in Florida Tuesday night. “The Marines came in. We had some great warriors come in; they did a fantastic job.”

He added: “They were there instantaneously, as soon as we heard. They came immediately. It’s in great shape. This will not be a Benghazi. Benghazi never should have happened. This will never, ever be a Benghazi. … As soon as we saw there was a potential for a problem, they got in."

UP TO 4,000 TROOPS COULD DEPLOY TO MIDDLE EAST AMID BAGHDAD UNREST: OFFICIALS

Hours earlier, Trump placed blame for the attack on the embassy in Iran. Defense Secretary Mark Esper announced the immediate deployment of an infantry battalion of about 750 soldiers from the Army’s 82nd Airborne Division to the Middle East. Three U.S. defense officials told Fox News they will be deployed to Kuwait amid the unrest in Baghdad.

In this photo provided by U.S. Department of Defense, U.S. Marines assigned to Special Purpose Marine Air-Ground Task Force-Crisis Response-Central Command (SPMAGTF-CR-CC) 19.2, prepare to deploy from Kuwait in support of a crisis response mission, Tuesday, Dec. 31, 2019. The SPMAGTF-CR-CC is designed to move to support operations throughout the Middle East. (U.S. Marine Corps photos by Sgt. Robert G. Gavaldon via AP)

In this photo provided by U.S. Department of Defense, U.S. Marines assigned to Special Purpose Marine Air-Ground Task Force-Crisis Response-Central Command (SPMAGTF-CR-CC) 19.2, prepare to deploy from Kuwait in support of a crisis response mission, Tuesday, Dec. 31, 2019. The SPMAGTF-CR-CC is designed to move to support operations throughout the Middle East. (U.S. Marine Corps photos by Sgt. Robert G. Gavaldon via AP)

Officials said more than 650 paratroopers are already on their way to Kuwait, and roughly 4,000 more have been told to pack their bags for a possible deployment.

“This deployment is an appropriate and precautionary action taken in response to increased threat levels against U.S. personnel and facilities, such as we witnessed in Baghdad today,” Esper said in a statement.

The 750 soldiers deploying immediately are in addition to 14,000 U.S. troops who had deployed to the Gulf region since May in response to concerns about Iranian aggression, including its alleged sabotage of commercial shipping in the Persian Gulf. At the time of the attack, the U.S. had about 5,200 troops in Iraq, mainly to train Iraqi forces and help them combat Islamic State extremists.

Iran has denied any involvement in the attack on the embassy. Foreign Ministry spokesman Abbas Mousavi was quoted by state media on Tuesday as warning the U.S. against any “miscalculation” in the worsening standoff.

STATE DEPARTMENT SPOKESWOMAN PRESSED ON WHETHER TRUMP ADMINISTRATION'S IRAN POLICY IS WORKING

State Department spokeswoman Morgan Ortagus told Fox News' "America's Newsroom" on Wednesday that the militiamen and their supporters are "not protesters."

"These were terrorists that are organized, trained and equipped by the Iranian regime," she said.

The U.S. and Iran have vied for influence over Iraq since the 2003 U.S.-led invasion that toppled Saddam Hussein. Iran has close ties to Iraq’s Shiite majority and many of its major political factions, and its influence has steadily grown since then.

CLICK HERE TO GET THE FOX NEWS APP

Dozens of pro-Iranian militiamen and their supporters had camped out overnight at the gates of the embassy in Baghdad. (AP Photo/Khalid Mohammed)

Dozens of pro-Iranian militiamen and their supporters had camped out overnight at the gates of the embassy in Baghdad. (AP Photo/Khalid Mohammed)

Iran helped to mobilize tens of thousands of mostly Shiite militiamen to battle the Islamic State group when it stormed across northern and western Iraq in 2014 as the armed forces collapsed. In the subsequent campaign against the extremists, the U.S. and Iran both provided vital aid to Iraqi forces, who eventually declared victory in December 2017.

The political influence of the Iran-backed militias, known as the Popular Mobilization Forces, has risen in recent years, and their allies dominate the parliament and the government. That has made them the target of mass protests since October that are unrelated to the attack on the embassy.

The embassy breach was seen by some analysts as affirming their view that it is folly for the U.S. to keep forces in Iraq after having eliminated the Islamic State group's territorial hold in the country.