The panic began slowly, with shoppers looking for face masks and hand sanitizer. But it hit a fever pitch over the weekend as crowds descended on supermarkets and big-box stores, snapping up cleaning supplies, toilet paper and nonperishable foods to prepare for the coronavirus.

“It has gotten crazier by the day,” said a Target employee who fulfills online orders at a store in Richmond, Va. “A lot of it is obviously panic-buying, people stocking up on eight gallons of water or 20 kinds of soups. Items are selling out immediately, as soon as they go up on shelves.”

The U.S. confirmed its first two coronavirus deaths over the weekend, sparking fears of a broader outbreak that prompted many Americans to make a run on their local supermarket, pharmacy or warehouse club. Long lines and bare shelves were common, even in areas without any known coronavirus cases. A Target store in Colma, Calif., sold out of bottled water. A Costco in San Francisco is out of Clorox wipes. The Home Depot is limiting customers to 10 face masks per person. Amazon, meanwhile, is warning shoppers that availability may be limited on its Prime Now grocery-delivery service. (Amazon chief executive Jeff Bezos owns The Washington Post.)

At Kings Pharmacy in Manhattan, the last shipment of Purell sold out within an hour. Now customers are showing up with Internet recipes for homemade hand sanitizers, leading to a spike on aloe vera gel and rubbing alcohol sales.

“Everything is on back order,” said Jones Chen, who owns the Manhattan pharmacy. “I’ve never seen anything like this.”

He ran out of Purell at 1 p.m. on Thursday, and got another 140 bottles at 6 p.m. An hour later, they were gone. Also sold out: disinfecting wipes from Wet Ones, Clorox and Lysol. Sales of regular hand soap, though — which doctors say provides the best line of defense — were about the same.

The relentless spread of the pneumonia-like virus now tied to more than 3,000 deaths worldwide has set off the kind of panic-buying normally reserved for natural disasters. But unlike a hurricane, which delivers destruction within a relatively confined window of time before moving on, there is no end in sight to this outbreak — and it’s making shoppers crazy.

“Consumers’ irrational behavior will certainly do more damage than reality will,” said Allen Adamson, a consumer brand consultant who teaches at New York University’s Stern School of Business. “People are emotionally driven and nervous, and nothing makes them more nervous than a threat they can’t see.”

Sales of medical masks have risen 78 percent in the most recent week, compared with the same period last year, according to Nielsen, a data tracking firm. Also spiking are sales of hand sanitizer (up 54 percent), thermometers (34 percent), disinfectant sprays (19 percent) and dried beans (10 percent).

An employee at a Whole Foods in Los Altos, Calif., said the store was out of “pasta, beans, frozen vegetables, hand sanitizer, toilet paper, paper towels. “There’s a little bottled water left,” she said. “I’ve worked here 10 years, and I’ve never seen anything like this.”

The national Centers for Disease Control and Prevention has warned that community spread of the coronavirus in the United States was inevitable, and urged businesses, hospitals and communities to brace for impact. So far, local transmission of the virus has been concentrated in California and Washington state, where it probably had been spreading undetected for the past six weeks, according to new research. By Monday afternoon, the U.S. death toll stood at six, all in Washington state.

The outbreak has sickened nearly 90,000 people in 60 countries since it emerged in Wuhan, China, in December.

Because the virus has the potential to become a global pandemic, the Department of Homeland Security recommends stockpiling a two-week supply of food and water, as well as prescription medications and nonprescription remedies like pain relievers and cough and cold medicines. Social media posts from around the world showed shoppers crowding into stores, forming long lines and climbing shelves to snag the last remaining items. Shoppers posted pictures of packed parking lots, barren shelves and signs warning of low or nonexistent inventories.

Shelf-stable and frozen foods were in high demand. At a Trader Joe’s market in Mountain View, Calif., the freezer section was cleared out of pizza and most ready-made meals by Sunday evening. There was no pasta or rice left. One woman’s cart was piled to the brim with frozen mushroom ravioli. Another cart was filled with six gallons of milk.

“It’s been crazy like this for the last three days,” said an employee, adding that the store set a new sales record on Saturday. He said demand for canned tuna had been particularly high.

Supply chain experts said the recent shortages are just the beginning of what could be months of coronavirus-related shortfalls. Household necessities and nonperishable foods are being hardest hit now, but U.S. retailers could soon be dealing with a scarcity of apparel and electronics, since those sectors rely heavily on Chinese factories, according to Per Hong, a senior partner at Kearney, a global management consulting firm.

“These near-term shortages are going to have very long-term implications with financial consequences 6 months, 12 months down the line,” he said.

Anxiety surrounding the virus has rippled through global economies as investors fear its rapid spread could bring more countries to a standstill; last week, it pushed U.S. stock markets into their worst week since the 2008 financial crisis. But the makers of quarantine-essential products, biotechnology and pharmaceutical firms — including Clorox, vaccine-maker Moderna and mask-manufacturer 3M — have seen their stocks rise. Vice President Pence is scheduled to visit 3M’s Minnesota headquarters later this week.

The U.S. surgeon general, Dr. Jerome Adams, took to Twitter on Saturday to implore the public to refrain from buying masks because a shortage could worsen the outbreak.

“They are NOT effective in preventing general public from catching #coronavirus, but if health care providers can’t get them to care for sick patients, it puts them and our communities at risk,” Adams tweeted.

Even Amazon hasn’t been immune to shortfalls. Many listings for masks and hand sanitizers across the e-commerce giant’s platform say products are “currently unavailable.” What inventory there is comes from third-party sellers and at premium pricing. A two-pack of 12-ounce Equate hand sanitizers is listed at $78.95, or $3.29 per fluid ounce. That’s easily 19 times the Walmart brand’s usual retail price. There was only one left in stock on Monday.

Amazon said it is cracking down on third-party vendors that are trying to profit from the frenzy. The company said it has already pulled listings for more than 1 million items that made false claims related to the coronavirus.

“There is no place for price gouging on Amazon,” Amazon spokeswoman Cecilia Fan told The Post. “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 long-standing policy, have recently blocked or removed tens of thousands of offers. We continue to actively monitor our store and remove offers that violate our policies.”

Manufacturers say they’re trying to replenish shelves as quickly as possible. Gojo Industries, the Akron, Ohio-based company that makes Purell, has “increased production significantly” and has employees working overtime to deal with booming demand, said spokeswoman Samantha Williams. The company has 2,500 employees and manufacturers Purell at two plants in Ohio and one in France.” We are seeing a substantial increase in demand,” she said in an email. “We have experienced several demand surges in the past during other outbreaks. This is on the higher end of the spectrum but not unprecedented.”

On Friday, the Food and Drug Administration reported the first manufacturing shortage of a drug due to the coronavirus. Although the agency declined to identify the drug, it confirmed that the shortage is a result of manufacturing freezes in China.

Jay Greene in Seattle and Christina Passariello in San Francisco contributed to this report.