In a long-awaited lawsuit, the Federal Trade Commission and 17 states sued Amazon on Tuesday, accusing the company of using illegal tactics to control online shopping in ways that stifled competition, and raised prices for consumers and costs to sellers.

Amazon said it would contest the lawsuit, which it says misunderstands how the retail industry operates and how its policies benefit consumers and sellers.

The F.T.C. focused on two main ways it said Amazon was breaking the law:

The F.T.C. said Amazon steers the prices of its competitors and effectively raises them for consumers. It said Amazon discouraged third-party sellers on its site from offering discounts on other websites by controlling a key piece of online real estate, an area on its site known as the “Buy Box.” This area on a product page prompts users to “Add to Cart” or “Buy Now,” and is a major driver of sales.

Amazon wants to offer competitive pricing, so it scours the web to make sure products are not available for less elsewhere.

“If customers trust they will only see competitive prices in our store, they come back more often,” Varun Soni, who leads Amazon’s seller pricing team, explained at a conference last year. He said a price is “considered uncompetitive even if it is just one cent above reputable retailers outside of Amazon.”

If a product is offered for less on another site, Amazon removes the Buy Box buttons for that seller on its site and replaces them with a less appealing design.

“As Amazon internally recognizes, eliminating a seller from the Buy Box causes that seller’s sales to ‘tank,’” the complaint said.

The F.T.C. said that selling on Amazon is so critical for sellers that they end discounts on other sites to regain the Buy Box on Amazon. That raises prices for consumers, the commission said, and makes it harder for other sites to compete on price.

Amazon said it didn’t want to promote bad deals to its customers, and if it had to change its policies, “we’d have to stop many of the things we do to offer and highlight low prices.”

The F.T.C. also said Amazon coerces sellers into using its vast fulfillment and delivery services if they want to succeed, raising prices for customers and blocking competition.

Using Amazon’s fulfillment services, the commission said, is a condition for a product to be eligible for fast and free delivery to customers who subscribe to Amazon’s Prime membership program.

Those product listings receive a “Prime” check-mark logo, and are easier to find on Amazon’s site. “The Prime designation makes sellers’ products more discoverable — and therefore likely to be purchased,” the F.T.C. said.

An estimated 170 million Americans have Prime memberships, making the Fulfillment By Amazon services essential, the lawsuit said.

The F.T.C. said that some sellers prefer to have a single fulfillment network for all their online orders, both on and off Amazon, and that running different sets of operations can be costly and make it harder to sell elsewhere. It also said Amazon deprives other warehousing and fulfillment providers from getting enough scale to compete.

Amazon said its logistics services were optional, and on average cost 30 percent less than standard services offered by other providers. It said sellers could choose not to use them, and many succeed by using other providers.

The pricing policies and fulfillment requirements reinforce each other, the F.T.C. said, deterring sellers from offering products at low prices elsewhere.