U.S. President Donald Trump said Friday that Washington will "reciprocate" after several countries — including Japan — issued travel warnings to the United States in the wake of a spate of deadly shootings.

Asked about the travel warnings, Trump said he was unfamiliar with the reports, but said the U.S. will take unspecified actions against countries that issued the warnings.

"Well, I can't imagine that," he said when told of the warnings. "But if they did that, we'd just reciprocate. We are a very reciprocal nation, with me as the head. When somebody does something negative to us in terms of a country, we do it to them."

In what may have been a subtle dig at Japan, Trump even hinted that allies such as Japan could be the target of these "reciprocal" actions, though it was not clear what actions the president could take in response.

"Look, our country has been taken advantage of by foreign countries, even allies — including allies, and in many cases, more than anybody else," he said. "We've been taken advantage of for many, many years, and it stops. It stopped."

Prompted by deadly shootings last week in Dayton, Ohio, and El Paso, Texas, that left 31 people dead, the Japanese Foreign Ministry warned citizens in the United States to stay vigilant against such dangers.

"Heeding to the possibility that shooting incidents could happen anywhere in the U.S., which is a gun society, please continue to stay alert as a precautionary measure," the Consulate General of Japan in Detroit said in a statement Sunday.