In a blog post, Facebook said it will remove offers to sell guns without background checks or across state lines illegally. Facebook will notify users offering to sell guns of relevant laws and limit the visibility of posts and pages about gun sales to users 18 and older.

The company also announced that searches for guns for sale on Instagram will prompt messaging reminding users of gun laws.

Facebook said it would rely on users to report posts and pages offering to sell guns. It said the changes will be implemented over the next few weeks.

The changes come after a six-week campaign by the advocacy groups Mayors Against Illegal Guns and Moms Demand Action for Gun Sense in America, which posted a video in February depicting illegal gun sales on Facebook. The groups planned to deliver more than 130,000 petitions seeking a crackdown on posts about illegal gun sales to Facebook headquarters before the company agreed to the new policies. Facebook also cited ongoing talks seeking new gun policies with New York Attorney General Eric Schneiderman, Americans for Responsible Solutions, and Sandy Hook Promise.