A similar policy will apply to Instagram, the company's photo-sharing network, Facebook said. The policies announced today will be implemented 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. "For example, we will remove reported posts where the potential buyer or seller indicates they will not conduct a background check or are willing to sell across state lines without a licensed firearms dealer."

New York Attorney General Eric Schneiderman and gun control groups have been asking Facebook to implement such restrictions. New York requires a federal background check for private gun sales and prohibits sales of some popular firearms, such as the AR-15. His office collected evidence that some website users were willing to sell guns without background checks or otherwise violate the sales restrictions of states with tougher gun control laws.

Mayors Against Illegal Guns, the group backed by former New York Mayor Michael Bloomberg, and Moms Demand Action have been pressuring Facebook to address the issue. Petitions from Moms Demand Action calling on Facebook to prohibit illegal gun sales had more than 230,000 signatures.