EBay is accusing Amazon of "unlawful and troubling" poaching of merchants on the platform, the company said Wednesday.

Amazon employees have been using eBay's seller messaging feature to sway merchants over to Amazon, eBay claims. The "scheme" has been going on for several years and in several countries, it says. EBay issued a cease-and-desist letter earlier this week.

"We have uncovered an unlawful and troubling scheme on the part of Amazon to solicit eBay sellers to move to Amazon's platform," eBay said in a statement. "We have demanded that Amazon end its unlawful activity and we will take the appropriate steps, as needed, to protect eBay."

An Amazon spokesperson told CNBC in a statement that the company is "conducting a thorough investigation of these allegations."

EBay says it found hundreds of messages in which Amazon employees sought to skirt the company's content monitoring — spelling out email addresses, adding extra characters to disguise the word "Amazon, and suggesting offline contact, for example.

The contact, eBay alleges, violates the California Comprehensive Computer Data Access and Fraud Act.

The Wall Street Journal first reported eBay's allegations.