“The fact that people reacted to what the White House said in such a way — in the 35 years I’ve been in pharmacy and pharmacy regulation, I’ve never seen that before,” he said.

More than 40,000 health care professionals were first-time prescribers of the drugs in March, according to the data, which is anonymized and based on insurance claims filed for about 300 million patients in the United States, representing approximately 90 percent of the country’s population. The data is current through April 14.

The data was compiled by IPM.ai, a subsidiary of Swoop, a company in Cambridge, Mass., that specializes in health care data and analytics based on artificial intelligence. It does not include drugs prescribed to patients in hospitals, where some doctors have administered the medication, or those released to hospitals from the Strategic National Stockpile. The data provided to The Times did not include the identities of the prescribers or the patients.

After Mr. Trump’s remarks last month, retail pharmacies across the country reported a run on the drugs, which are mostly prescribed by a small subset of medical specialists. Within days, states began issuing emergency orders to restrict the new prescriptions.

Gwendolyn Young walked into her pharmacy in Los Angeles four days after the president’s March 19 briefing, trying to pick up a 90-day prescription of hydroxychloroquine. She has taken the medication for more than 30 years to treat lupus. The drug, while approved for malaria, is also used to treat lupus and other autoimmune diseases like rheumatoid arthritis. Hundreds of thousands of patients across the United States rely on it to keep painful symptoms at bay.

At the pharmacy, Ms. Young said, she was told to start rationing her pills because the drug was being given only to patients who had Covid-19. She was eventually able to get a 14-day supply, but the uncertainty has made her anxious.

“Will I have to keep doing this every 14 days?” she said. “What happens to those people who don’t push the way I do?”