The Trump administration said Tuesday it has detected “active preparations” by Syria for a chemical attack and threatened to retaliate — warning of action that could plunge America deeper into a civil war alongside the fight against Islamic State militants.

The chemical threat and sudden White House warning illustrate the challenging complexities of the fighting in Syria, a country whose territory was used by IS to march into Iraq in 2014 and prompt a U.S. return to the Middle East’s battlefield. Washington now has more than 5,000 troops in Iraq and about 1,000 in Syria.

In this May 18, 2017 file photo, a Syrian National flag hangs out of a damaged building at the mountain resort town of Zabadani in the Damascus countryside, Syria. (AP Photo/Hassan Ammar, File | Manila Bulletin)

President Donald Trump has said he won’t stand for Syria’s use of chemical weapons, which are banned under international law and are particularly worrisome in the Arab country because they could fall into extremists’ hands.

The Pentagon said the preparations detected by the U.S. occurred at the same air base where Syrian aircraft embarked on a sarin gas strike on April 4, killing almost 90 people. Days later, Trump ordered a cruise missile attack against the base in retaliation.

The Syrian government has denied it ever used banned chemicals, and it rejected Washington’s latest allegation Tuesday.

Syria’s two main allies, Russia and Iran, joined in bashing Washington. Iran’s foreign minister called the U.S. threat a “dangerous escalation.” A senior Russian lawmaker accused the U.S. of a “provocation.”

It was unclear if the U.S. saw a Syrian attack as imminent. Nevertheless, the White House showed it wouldn’t turn a blind eye. Since Trump’s inauguration, U.S. involvement in Syria has deepened. Earlier this month, the U.S. shot down a Syrian fighter jet for the first time. It has twice downed Iranian drones.

The U.S. cruise missile strike in April was the first intentional American assault on Syrian President Bashar Assad’s government or military.

The White House issued a brief written statement Monday night saying it had detected potential preparations for another chemical attack and emphasizing the Syrian government would “pay a heavy price” if it proceeded. Hours later, the Pentagon elaborated without offering many specifics.

“We have observed activities at Shayrat air base that suggest possible intent by the Syrian regime to use chemical weapons again,” a Pentagon spokesman, Marine Maj. Adrian Rankine-Galloway, said. He said Assad’s “brutality” threatens the region and U.S. interests, and any Syrian attacks with weapons of mass destruction risk prompting others to use similar weapons.

Chemical weapons have killed hundreds of people since the start of Syria’s six-year civil war. The U.N. has blamed three attacks on Assad’s government and a fourth on the Islamic State group. The U.S. and its Arab and Western allies, and Syrian opposition groups, accuse Assad’s forces of many more instances of using sarin and chlorine against civilians.

The White House threat essentially draws a “red line” on chemical weapons in much the same manner President Barack Obama did. There is one major difference: Whereas Obama backed down from a threat to use force after a 2013 attack, opting instead for a diplomatic plan to remove Syria’s chemical weapons arsenal, Trump has proven his willingness to authorize military force. U.S. officials say Assad never fulfilled the demand of Obama’s deal with Russia, keeping control of some stockpiles.

Underscoring the messiness of Syria’s crowded battlefield, a Britain-based human rights group on Tuesday accused the U.S.-led coalition of striking an Islamic State-run jail in eastern Syria, killing more than 40 prisoners. The strike also reportedly killed IS militants, according to the Syrian Observatory for Human Rights.

U.S. Army Col. Ryan Dillon, a spokesman for the coalition, said in an email that the allegation will be assessed based on what can be determined about coalition strikes against Islamic State command and control facilities and other IS infrastructure in Mayadin, Syria, June 25 and 26.

“The removal of these facilities disrupts ISIS’s ability to facilitate and provoke terrorist attacks against the coalition, our partner forces and in our homelands,” he said. “This mission was meticulously planned and executed to reduce the risk of collateral damage and potential harm to non-combatants.”

Nikki Haley, Trump’s U.N. envoy, said the White House warning on Syria was meant for a wider audience.

“The goal is at this point not just to send Assad a message, but to send Russia and Iran a message,” Haley told a House panel.

The overnight White House threat caught many in Trump’s own administration by surprise.

Several State Department officials typically involved in coordinating such announcements said they were caught off guard, and it appeared the underlying intelligence information was known only to a small group of senior officials. Typically, the State Department, Pentagon and U.S. intelligence agencies would all be consulted before a White House declaration sure to ricochet across foreign capitals.

The State Department officials weren’t authorized to discuss national security planning publicly and requested anonymity.

On Tuesday, deputy White House spokeswoman Sarah Huckabee Sanders said “all relevant agencies … were involved in the process from the beginning.”

A non-governmental source with close ties to the White House said the administration had received intelligence the Syrians were mixing precursor chemicals for a possible sarin gas attack in either the east or south of the country, where government troops and allied forces have faced recent setbacks.