NEW YORK -- Retailers including Wal-Mart, Sears and Amazon have agreed to keep realistic toy guns off their shelves in New York as part of a settlement with the state.

Attorney General Eric Schneiderman said Monday that the retailers also agreed to pay over $300,000 in penalties.

Schneiderman's office found that over 6,400 toy guns sold from 2012 to 2014 violated New York laws, the New York Times reported.

New York is among a handful of states that introduced legislation in 2015 to create or amend toy gun laws.

That push has increased since a Cleveland police officer fatally shot 12-year-old Tamir Rice in November as he was holding a realistic-looking toy gun.

The new deal requires retailers to apply New York City's strict standards to sales statewide. New York state prohibits the sale of black, blue, silver or aluminum toy guns; New York City requires that imitation guns be brightly colored.

Schneiderman's office also sent cease and desist letters to 65 third-party sellers that sold the toys in New York through Amazon, which did not immediately respond to comment requests.