Facebook will delete posts from users seeking to buy or sell weapons illegally or without a background check.

A similar policy will be applied to Instagram, said Time. The measures will be put into effect over the next few weeks.

“We will remove reported posts that explicitly indicate a specific attempt to evade or help others evade the law,” the company said in a statement.

Google Plus and Craigslist already prohibit all gun sales, legal or illegal.

Facebook said that instead of patrolling its network for violators, it will rely on reports from users and police,  said Time.

The new policy was worked out in an agreement with New York Attorney General Eric Schneiderman, who has been pressing the company along with Mayors Against Illegal Guns, a group backed by former New York Mayor Michael Bloomberg, and Moms Demand Action. Moms Demand Action collected more than 230,000 signatures on petitions calling on Facebook to act.

In crafting the new policy,  said Time, Facebook had to confront a patchwork of gun laws around the country. New York, for example, has some of the nation’s toughest gun laws. It prohibits the sale of weapons such the AR-15 semi-automatic rifle, and it is one of 16 states that require background checks on buyers making private firearm purchases.

Under the new policy, Facebook would allow a user to list an AR-15 as long as it wasn’t offered for sale in states where the weapon is illegal.

Also, Facebook will remove any posts in which a gun seller offers to skip a background check, even if such checks aren’t required in the seller’s state. And it will delete offers to sell guns across state lines without the involvement of a licensed firearms dealer, something required under federal law,  said Time.

The company already has systems in place to remove advertising that is false and deceptive, and it prohibits ads for illegal drugs, tobacco and prescription drugs.