BERLIN — A few weeks ago, it felt as if a trade war pitting the United States against allies like Australia, Canada and the European Union was over before it even began. The Trump administration dispensed so many temporary exemptions to steel and aluminum tariffs that many countries figured the threats were just political theater.

But with only days left before the exemptions expire and punitive tariffs take effect, it’s dawning on foreign leaders that decades of warm relations with the United States carry little weight with a president dismissive of diplomatic norms and hostile toward the ground rules of international trade.

What began as a way to protect American steel and aluminum jobs has since become a cudgel that the Trump administration is using to extract concessions in other areas, including car exports to Europe or negotiations to revise the North American Free Trade Agreement with Mexico and Canada.

As a May 1 deadline looms, the decision on whether to grant permanent exemptions to the steel and aluminum tariffs, and to whom, appears likely to come down to the whims of President Trump, who has seesawed between scrapping and rejoining global trade deals.