Nearly all countries agreed on Friday to a legally binding framework to curb plastic waste, which has become a major threat to the marine environment, the United Nations said.

Under the amended Basel Convention, which regulates the transboundary movements of hazardous wastes, dirty plastic deemed unsuitable for recycling will be added to the list of waste subject to controls, requiring consent by importing countries prior to export.

The amendment, adopted by about 180 governments, will "make global trade in plastic waste more transparent and better regulated, whilst also ensuring that its management is safer for human health and the environment," the secretariat of the convention said in a press release.

Japan, which along with Norway submitted the amendment proposal, has exported part of its plastic waste to China and developing countries. The latest move is likely to lead Japan to step up its efforts to recycle more of the waste inside the country.

"We need to prepare domestic laws" by January 2021 when the revised treaty will come into force, Yutaka Matsuzawa, a Japanese Environment Ministry official, told reporters after attending the Conference of the Parties to the Basel Convention in Geneva.

About 300 million tons of plastic waste is produced every year, of which 8 million tons end up in the world's oceans, according to the U.N Environment Program.

While China generated the largest amount of plastic packaging waste in 2015, Japan was responsible for the largest amount per capita after the United States, data from the U.N. Environment Program showed. Such waste accounts for around half of the plastic waste generated globally.

The United States signed the Basel Convention in 1990 but has yet to ratify it.

Of Japan's total plastic litter in 2017, 23 percent was recycled. But only 40 percent was processed domestically, according to the Tokyo-based Plastic Waste Management Institute. The country has relied largely on low-cost recycling in developing countries.