BEIJING—Facebook Inc. and its photo-sharing app Instagram sued four companies and three people based in China for allegedly creating and selling fake online accounts, likes and followers that were used for misinformation campaigns and other scams.

Starting in 2017, the companies marketed and sold fake accounts in large quantities through six websites with similar domain names to Facebook such as myfacebook.cc and 9xiufacebook.com, according to the complaint filed Friday in San Francisco federal court.

Facebook...