Ms. Healey’s office said it had received about 140 complaints of price gouging, including a report of a four-pack of toilet paper selling for $25 on eBay and pharmacies charging $30 for 8 ounces of hand sanitizer.

She said her office was investigating. Violators could be fined $5,000, she said.

“It’s OK to make money,” Ms. Healey said. “It’s OK to make a profit. But there is a line.”

The United States attorney general, William P. Barr, recently directed federal prosecutors across the country to prioritize fraud schemes related to the pandemic and to prosecute offenders.

“If you have a big supply of toilet paper in your house, this is not something you have to worry about,” Mr. Barr said at a White House briefing on Monday. “But if you are sitting on a warehouse full of surgical masks, you will be hearing a knock on your door.”

Amazon said it monitored price changes using manual and automated methods. It said it had removed more than half a million listings for price gouging and had suspended 3,900 sellers. The company said it had also worked with more than 40 attorneys general to hold predatory vendors accountable.

“There is no place for price gouging on Amazon,” the company said in a statement. “We are disappointed that bad actors are attempting to artificially raise prices on basic need products during a global health crisis and, in line with our longstanding policy, have recently blocked or removed hundreds of thousands of offers.”

In many states, regulators said they were racing to investigate the complaints pouring into their consumer hotlines.