FILE PHOTO: Amazon.com's logo is seen at Amazon Japan's office building in Tokyo, Japan, August 8, 2016. REUTERS/Kim Kyung-Hoon/File Photo

WASHINGTON (Reuters) - Amazon.com Inc will pay a $1.2 million penalty to settle nearly 4,000 alleged violations of U.S. law in a move to prevent harmful exposure to pesticides through illegal sales, the U.S. Environmental Protection Agency said on Thursday.

Amazon agreed to closely monitor and remove illegal pesticide products from its website in an effort to “significantly reduce the number of illegal pesticides available through the online marketplace,” the EPA said.

Amazon’s violations were for selling and distributing imported pesticide and insecticide products that had been not licensed for sale in the United States, the EPA said.

Amazon said third-party sellers had sold the products through its website.

Ed Kowalski, EPA’s enforcement director for the region that includes Amazon’s headquarters in Seattle, said the retailer was warehousing, packaging, shipping and profiting off the products.

“They have a responsibility whether to determine whether the products that they’re selling are pesticides and, if so, whether they’re illegal pesticides.”

Amazon immediately removed the products from its website, banned foreign sellers from selling pesticides and stepped up the monitoring of its website for illegal pesticides, the EPA said.

Amazon also asked customers who purchased the products in 2013-2016 to communicate safety concerns, urged them to dispose of the items and refunded customers the cost of the products, about $130,000, the EPA said.

“Regulatory compliance is a top priority at Amazon. Third-party sellers are required to comply with all relevant laws and regulations when listing items for sale on Amazon,” the company said.