Washington — Secretary of Defense Mark Esper warned Thursday there are indications Iranian-backed Shiite militias in Iraq are planning additional attacks in the wake of violent demonstrations at the U.S. Embassy in Baghdad this week.

"Do I think they may do something? Yes," Esper told reporters at the Pentagon. "And they will likely regret it. And we are prepared to exercise self defense and we are prepared to deter further bad behavior from these groups, all of which are sponsored and directed and resourced by Iran."

The U.S., he added, would take "preemptive action" if it learns of a planned attack.

Get Breaking News Delivered to Your Inbox

"The game has changed," Esper said. "We're prepared to do what is necessary to defend our personnel and our interests and our partners in the region."

Hundreds of militiamen and their supporters stormed the U.S. Embassy compound in Baghdad on Tuesday during two days of mass demonstrations, heightening tensions between the U.S. and Tehran. The attack on the embassy was spurred by U.S. airstrikes Sunday that killed 25 fighters of the Iran-backed militia and were conducted in retaliation for the killing of an American contractor in a missile attack, which the U.S. blamed on the militias.

Several dozen Marines were sent to the embassy to boost security amid the demonstrations, and the U.S. deployed additional troops to the Middle East to strengthen its presence. On Wednesday, the second day of protests at the compound, the militiamen retreated following an appeal from the Iraqi government.

U.S. officials said a group of three ships carrying another 2,000 Marines has canceled a scheduled exercise off in Morocco and will head to the Persian Gulf as part of the reinforcements heading to the region.

General Mark Milley, chairman of the Joint Chiefs of Staff, told reporters the militias have been engaged in a "sustained campaign" against U.S. forces and coalition partners since at least October, which has "increased in tempo and intensity." The rocket attack that killed the American contractor and wounded others was "designed to inflict damage and kill," he said.

While Milley said it's "highly unlikely" the embassy would be physically overrun, he warned anyone who attempts to do so "will run into a buzz saw."

President Trump and Secretary of State Pompeo have blamed Iran for the assault on the U.S. Embassy compound, which is one of the most heavily fortified diplomatic outposts in the world. Pompeo called the attack "state-sponsored terror" and postponed a scheduled trip to Ukraine, the country at the center of the House's impeachment inquiry into Mr. Trump, to monitor the crisis.

The president, meanwhile, asserted Iran would be "held fully responsible for lives lost, or damage incurred" at the compound and "pay a very big price."

"This is not a Warning, it is a Threat," he tweeted Tuesday.

David Martin contributed reporting.