A class action alleges Amazon.com Inc. violates federal antitrust laws by monopolizing the online retail marketplace through agreements with third-party sellers.

The lawsuit, filed Thursday by two customers, one in California and one in Virginia, says Amazon’s policies with third-party sellers force them to sell their products on their own sites, or competitor sites, at the same prices as they do on Amazon. That restricts competition for shoppers looking for the best prices, the suit says.