TOKYO — After months of taking hits from the United States over North Korea policy and trade, Japan has decided that it will only be pushed so far, and is threatening to punch back.

On Friday, Japan notified the World Trade Organization that it was reserving the right to impose retaliatory tariffs against the United States in response to tariffs on steel and aluminum imports proposed by President Trump.

Japan has not yet filed a formal complaint with the W.T.O., but is signaling that it could impose the retaliatory measures if it does not gain tariff exemptions that it has been seeking from Washington.

For Japan, where Prime Minister Shinzo Abe has worked hard to cultivate a close relationship with President Trump on the golf course and over the telephone, the preliminary notice to the W.T.O. was symbolically significant.