Under pressure from gun control advocates, Facebook has agreed to delete posts from users selling illegal guns or offering weapons for sale without background checks.
The social networking site says a similar policy will apply to Instagram, its photo-sharing platform.
The policies announced Wednesday will be implemented over the next few weeks.
New York Attorney General Eric Schneiderman and gun control groups have been talking to Facebook to get restrictions.
The state requires a federal background check for private gun sales and prohibits selling some popular firearms, such as the AR-15.
Facebook says it will remove posts regarding buying or selling guns that indicate an attempt to evade the law, including interstate sales without a licensed firearm dealer involved.