The events of the past several days amount to a violent cat-and-mouse game between Washington and Tehran, as Iran bridles under economic sanctions and seeks to exact a price from the United States. Those sanctions contributed to mass protests that the country’s leaders say were instigated by the United States to bring down Iran’s regime.

Trump administration officials, particularly Secretary of State Mike Pompeo, have long spoken about the need to “restore deterrence” against Iran to check its military activities in the Middle East. They blame President Barack Obama for emboldening Tehran through the 2015 nuclear deal. But supporters of the agreement say that Mr. Trump’s May 2018 withdrawal from it prompted Iran and its proxies to adopt a more aggressive posture toward the United States.

Meanwhile, some of Mr. Trump’s allies fear that a president who has repeatedly called for winding down “endless wars” has effectively condoned Iranian behavior by shying away from military force. In mid-June, Mr. Trump ordered limited airstrikes to punish Iran for shooting down an expensive American drone near its coastline, only to call off the attack at the last minute. Mr. Trump also defied calls from some Republican supporters to strike at Iran after it attacked a major Saudi oil production facility in September.

Mr. Trump has also said he would like to negotiate a new nuclear agreement with Iran’s leaders. But Iran has refused to discuss its nuclear program until Mr. Trump rolls back economic sanctions, including on oil exports, a step the president has refused to take.

Mr. Trump was cheered on by some Republican allies on Tuesday, including Senator Lindsey Graham of South Carolina, a longtime advocate of confrontation with Iran who golfed with the president in Florida on Tuesday.

Mr. Graham praised Mr. Trump on Twitter for “acting decisively” and told Iran that the president “will hold you accountable for threats against Americans and hit you where it hurts the most.” He also issued a veiled threat of further military action, telling the Iranian government that “a country that depends on the ability to refine oil for its existence needs to be cautious.”