President Donald Trump on Thursday criticized Japan, China and other countries for dumping into oceans a massive amount of garbage that has drifted ashore on the U.S. West Coast.

"Every year, over 8 million tons of garbage is dumped into our beautiful oceans by many countries of the world. That includes China, that includes Japan, that includes many, many countries," Trump said as he signed into law a related measure called the Save Our Seas Act.

Trump said a "vast," "tremendous" and "unthinkable" amount of garbage is floating to the West Coast, causing a "very unfair situation" as the United States is charged with cleaning it up.

His reference to Japan may be linked to debris from the tsunami that engulfed northeastern Japan after the 2011 massive earthquake.

Trump said he has told most of the foreign governments concerned to address the problem.

"We will be responding, and very strongly," he said. "As president, I will continue to do everything I can to stop other nations from making our oceans into their landfills."

According to the president, the new legislation will release funds to U.S. states for cleanup and response efforts. It also encourages the U.S. government to engage with countries responsible for dumping garbage into oceans.

Trump cited a trilateral trade deal revised recently with Mexico and Canada as the first U.S. trade agreement ever to include commitments by the parties to cooperate in addressing land- and sea-based pollution and improve waste management.