Fake guns that look too much like the real thing are now banned in New Jersey under a new law that seeks to prevent police from mistakenly shooting people carrying toy firearms.

Gov. Phil Murphy on Tuesday signed a bill into law barring the sale of toy guns and imitation firearms that may be reasonably confused for a real weapon.

The legislation comes after several years of outcry following high-profile police-involved shootings, many which killed unarmed black men. But two separate incidents in Ohio caused particular outrage after police shot 12-year-old Tamir Rice and 13-year-old Tyre King dead, after mistaking toy guns they boys had for real weapons and opening fire.

To continue selling fake guns in the Garden State, toy manufactures now must abide by the following guidelines under the new law (A4260):

The guns must be a color other than black, blue, silver or aluminum.

They must have an orange stripe at least one inch in width. It must run the entire length of each side of the barrel and cannot be removable.

The barrel, which must be at least one inch in diameter and closed at a distance of at least one-half inch from the barrel’s front end, must be made with the same material as the gun.

Imitation firearms used in movies and films are exempt from the ban.

Those caught selling toy guns that do not meet the new standards face a fine of $500 for a first offense and subsequent penalties of $1,000.

The Democratic-sponsored bill passed the state Senate 32-6 and the state Assembly 54-19, with 4 abstentions. Both houses are controlled by Democrats.

Amanda Hoover can be reached at ahoover@njadvancemedia.com. Follow her on Twitter @amandahoovernj. Find NJ.com on Facebook.

Get the latest updates right in your inbox. Subscribe to NJ.com’s newsletters.