SEATTLE (AP) — The Environmental Protection Agency on Thursday announced a $1.2 million settlement with Amazon over the sale and distribution of illegal pesticides, one of the largest penalties assessed under federal pesticides laws.

Federal regulators said the agreement settles allegations that the Seattle-based internet giant committed nearly 4,000 violations between 2013 and 2016 for selling and distributing imported pesticide products not licensed for sale in the United States.

The pesticides, including insecticide in the form of chalk and cockroach bait powder, were sold by independent sellers who offered the products through Amazon's website.

The products were sold through a program in which sellers provided products to Amazon, which stored them at its warehouses and shipped them after they were purchased, Chad Schulze, an EPA pesticide enforcement team lead, said at a news conference in Seattle Thursday.

It's one of the first enforcement actions related to sales of illegal pesticide in the online marketplace, he added.

In a statement, Amazon said complying with regulations was a "top priority" and that it works quickly to take action when third-party sellers don't follow the rules.

As part of the agreement filed in administrative court Wednesday, Amazon agreed to develop an online training course to educate sellers about pesticides. The training will be available to the public and online sellers and available in English, Spanish and Chinese.

"This settlement is a step in the right direction to protect the public health and the environment," said Ed Kowalski, who directs compliance and enforcement for the EPA region covering the Pacific Northwest.

EPA interns uncovered the illegal sales in 2014 while reviewing online marketplaces, identifying unregistered insecticide chalk being sold on

EPA officials purchased and analyzed those products. It then issued two orders stopping sales, once in mid-2015 for the insecticide chalk and a second time in early 2016 after finding six other unregistered pesticides.

EPA officials said Amazon quickly removed the products and prohibited foreign sellers from selling the pesticides. In October 2016, the company notified people who bought the illegal pesticides and urged them to dispose of them. It also made refunds totaling about $130,000.

Most were purchases by individuals.

The EPA has limited tools to enforce laws against foreign sellers so regulators focus on services in the U.S. that are facilitating the sale of these products, Schulze said.

Illegal pesticides are still widely available for online purchase in the U.S., the EPA said.

"This is a very difficult avenue of pesticide sales to get our hands around and that's what this action is starting to try to do," Schulze said.