Wal-Mart, Sears, Amazon and other retailers have agreed to halt the sales of realistic-looking toy guns in New York and pay more than $300,000 in penalties, New York Attorney General Eric Schneiderman announced Monday.

Schneiderman’s office found that five retailers and their third-party sellers sold more than 6,400 toy guns from 2012 to 2014 that violated New York laws. Most of the toys were sold online.