WASHINGTON — The United States is sending approximately 3,000 soldiers to the Middle East after thousands of people stormed the compound of the U.S. Embassy in Baghdad, three U.S. defense officials and one U.S. military official confirmed to NBC News on Friday.

The news came hours after an American airstrike killed Gen. Qassem Soleimani, the commander of Iran's secretive Quds Force and one of the country's most powerful figures, but U.S. defense officials said the deployments were not in response to the strike.

The deployment of additional soldiers from a brigade of the 82nd Airborne Division, based at Fort Bragg, North Carolina, comes after thousands of people, most of them affiliated with the Iran-backed Shiite militia group Kataeb Hezbollah, descended on the embassy compound Tuesday.

The soldiers will join roughly 650 others already deployed to the region and stay there for some 60 days, the officials said. The immediate response force will be spread throughout the region, with some soldiers in Iraq and others in Kuwait.

"As previously announced, the Immediate Response Force (IRF) brigade of the 82nd Airborne Division was alerted to prepare for deployment, and are now being deployed," the Pentagon said in a statement.

"The brigade will deploy to Kuwait as an appropriate and precautionary action in response to increased threat levels against U.S. personnel and facilities, and will assist in reconstituting the reserve."

U.S. and Iraqi officials said the attack on the embassy compound began as a large crowd gathered after funerals for some of those who were killed in U.S. airstrikes Sunday.

Download the NBC News app for breaking news and politics

The protesters marched to the embassy compound, where they tried several times to breach security and enter the main building, according to a U.S. official with knowledge of the situation, who said the crowd threw Molotov cocktails over the walls and tried to burn down the entry gates.

At least 25 militia fighters were killed in the U.S. airstrikes Sunday on weapons depots in Iraq and Syria that the United States said were linked to Kataeb Hezbollah.

At the time of the drone attack, Soleimani had been "plotting imminent and sinister" attacks against U.S. interests, President Donald Trump said from his Mar-a-lago resort in Florida on Friday, in his first public remarks after ordering the airstrike that killed Soleimani.

"We caught him in the act and terminated him," Trump said. "His reign of terror is over."