Amazon has reached a settlement with the U.S. Environmental Protection Agency over “unregistered and misbranded pesticide products” for sale on the company’s marketplace. In a statement Thursday, the EPA claimed Amazon was guilty of close to 4,000 violations of federal pesticide law.

Amazon will pay a penalty of $1,215,700 as part of the settlement, the EPA says. The company also agreed to develop an online course to educate pesticide sellers, the public, and marketers on federal pesticide regulations and policies. The course will be offered in English, Spanish, and Chinese and it will be mandatory for any retailer selling pesticides on Amazon.com.

Update: Amazon provided the following statement to GeekWire regarding the settlement.

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. When sellers don’t comply with our terms, we work quickly to take action on behalf of customers. We will continue to innovate on behalf of our customers and to work with brands, manufacturers, government agencies, law enforcement, and others to protect the integrity of our marketplace

The EPA began investigating the imported pesticides, which were not licensed for sale in the U.S., back in 2014. The agency ordered Amazon to stop selling certain pesticides several times. Amazon responded by pulling the products from the marketplace and notifying and refunding customers who purchased them. Refunds amounted to about $130,000 according to the EPA.

“This agreement will dramatically reduce the online sale of illegal pesticides, which pose serious threats to public health in communities across America,” Chris Hladick, the EPA’s regional administrator, said in a statement. “Amazon is committed to closely monitoring and removing illegal pesticides from its website, and EPA will continue to work hard to ensure these harmful products never reach the marketplace.”