WASHINGTON — New sanctions that the Trump administration imposed on Friday to punish Tehran’s latest ballistic missile test marked the beginning of what officials called the end of an era in which the United States was “too tolerant of Iran’s bad behavior.”

In what was described as the first in a series of efforts to confront Iran around the globe, the ban on banking transfers was levied against 25 Iranians and companies that officials said assisted in Tehran’s ballistic missile program and support of terrorist groups.

The immediate trigger for the sanctions, which drew from a list of targets drawn up last year by the Obama administration, was Iran’s missile test last Sunday. The exact details of the test remain shrouded in considerable mystery. But the way the two countries jabbed at each other — with the White House saying it would “no longer tolerate Iran’s provocations that threaten our interests,” and Iranian state news media vowing retaliation — had distinct echoes of the darkest days before the July 2015 nuclear accord was reached.

In striking that deal 19 months ago, the Obama administration was gambling that, over time, Washington and Tehran would learn how to manage their differences and cooperate on one or two discrete projects, starting with eliminating the Islamic State. But that era never arrived. And with the announcements on Friday, it became clearer than ever that leaders in both countries now see an advantage in taking a hard line — each betting that the other does not have the stomach for a risky, expensive confrontation.