The American Medical Association denounced the practice in a statement from its president, Dr. Patrice Harris.

“The A.M.A. is calling for a stop to any inappropriate prescribing and ordering of medications, including chloroquine or hydroxychloroquine, and appealing to physicians and all health care professionals to follow the highest standards of professionalism and ethics,” she said.

Dr. Harris also noted that the country’s health care professionals “continue to demonstrate remarkable leadership every day,” and can look to the organization’s code of medical ethics for guidance.

The first restrictions were imposed last week in Idaho. The board there imposed a temporary rule barring pharmacies from dispensing two drugs — chloroquine and hydroxychloroquine — unless the prescription includes a written diagnosis of a condition that the drugs have been proven to treat. The rule also limits prescriptions to a 14-day supply unless a patient has previously taken the medication.

“We wanted to try to get out in front of that as early as we could,” said Nicki Chopski, executive director of the board in Idaho, where pharmacists began reporting a significant uptick in prescriptions for the medications last week. The prescriptions, she said, were being written by doctors for themselves and their family members, often in large quantities with refills.

Texas adopted a similar rule on Friday that included another malaria drug — mefloquine — as well as the antibiotic azithromycin, commonly known by its brand name, Zithromax Z-Pak. That drug has been mentioned by Mr. Trump as another potential treatment for the coronavirus when taken in conjunction with the anti-malarial hydroxychloroquine. The effectiveness of the treatment is unproven.

Allison Benz, executive director of the Texas State Board of Pharmacy, said pharmacists were reporting an unusual increase in prescriptions for these drugs written by doctors for themselves, their family members and their office staff. As in Idaho, patients who legitimately need medications for conditions that the drugs have been proven to treat will not be restricted from getting them as a result of the new rule, Ms. Benz said.