WASHINGTON — The United States military will pre-emptively strike Iranian-backed forces in Iraq and Syria if there are indications the paramilitary groups are planning more attacks against American bases and personnel in the region, Defense Secretary Mark T. Esper said Thursday.

The strong warning comes less than a week after Kataib Hezbollah, an Iranian-supported militia, killed an American contractor in a rocket attack near the Iraqi city of Kirkuk, and is the latest round of escalating language leveled at Tehran by officials in Washington.

“If we get word of attacks, we will take pre-emptive action as well to protect American forces, protect American lives,” Mr. Esper said. “The game has changed.”

The American military responded to the rocket attack last week by bombing Kataib Hezbollah outposts in Syria and Iraq, killing some of its fighters. The airstrikes set off a chain of events that culminated Tuesday with many members of the same militia attacking the American Embassy in Baghdad. The group that attacked the embassy was distinct from those Iraqis who have been protesting the Iraqi government for months, demonstrations in which hundreds have been killed by the country’s security forces.