MEXICO CITY — During the bone-dry days of Prohibition, Americans slipped over the border to guzzle beer in Mexico.

A century later, Mexican towns are the ones going dry.

The government has largely shut down beer production, saying that it is not essential during the country’s coronavirus outbreak. The last bottles of Tecate, Corona, Modelo Especial and Dos Equis for Mexican consumption rolled off the lines in early April.

Now the country has a new black market — in beer.

“Many people are desperately searching for beer,” said Raúl Funes, the head of a craft-brew association in Tijuana, just south of San Diego. “It’s like toilet paper.”

It’s not that Mexico has no booze. The wine industry is still open. But Mexican adults, on average, drink a quart of wine per year. They knock back 72 times as much beer. That is 18 gallons a person.

“Beer is a symbol of celebration, of refuge, it’s something to cure depression, to have at a party, a wedding, to drink at home,” said Luis Alberto Medina, the host of a radio show in the northern city of Hermosillo. “It’s always been present in Mexican culture.”

Until now.

The country’s biggest convenience-store chain, Oxxo, announced the doomsday news on April 30: It had only 10 days’ worth of beer left.

Already, six-packs were becoming as rare as cruise ships off Cozumel.

Panicked shoppers had hauled away cases from supermarkets in early April. On a recent day, word spread that a truck was delivering beer to an Oxxo in Hermosillo. A line snaked outside and continued down the highway: scores of people masked, socially distanced — and thirsty.

For the few beers left, prices have soared.

One Twitter user reported buying a can of Modelo Especial for 27 pesos, or around $1.15. That is more than the hourly minimum wage. “Yes, the world is coming to an end,” he wrote.

In Tijuana, Facebook pages have sprung up to direct people to stores that still have beer, or to people willing to sell from their private stashes.

“Where is there beer at a normal price?” one user anguished.

Someone responded with an American flag emoji.

Indeed, at a number of border crossings, beer is being discreetly carried south, even as illicit drugs flow north.

Lupita Flores, 34, runs a corner store in Reynosa, just across from McAllen, Tex. She ran out of beer weeks ago. So she arranged to have it sent from “the other side” — as Mexicans call the United States.

“Sometimes it costs double or triple,” she said. Her suppliers can bring only small amounts on each trip, to avoid getting into trouble. Travelers are allowed to bring up to three liters of beer into Mexico duty-free — around eight 12-ounce cans.

Despite the premium cost, Flores needed to stock up. Many of her customers work in the border assembly plants known as maquiladoras.

“When they get paid, the first thing they do is come get their beer,” she said.

Karen Treviño, 30, a graphic designer, had scoured Reynosa for Corona and Michelob Ultra. “We’ve been looking in supermarkets, shops, in Oxxos, in 7-Elevens,” she reported. “Nothing.”

She, too, turned to contacts in the United States, where the flow of suds has continued, uninterrupted. Beer as a nonessential product? Por favor. “We northerners are party people,” she said.

Tijuana boomed during Prohibition, the period from 1920 to 1933 during which the United States banned alcohol production and sales. Beer-deprived Americans flocked to “the longest bar in the world,” the 200-foot marvel at the city’s Mexicali Beer Hall.

These days, though, Tijuana’s stores are nearly out of beer. And because of restrictions imposed after the coronavirus outbreak, it’s harder to cross the border. But residents with jobs in California can still make the trip and pick up a six-pack or two on their way home.

Thanks to the commuters, “20 percent of the population has beer,” said Ricardo Ocampo, a professor of food science at the Technological Institute of Tijuana.

Everyone else, he said, faces a dire situation.

“We are talking about a very high percentage of people whose only option is craft beer.”

Yes, craft beer — long dismissed by the Corona crowd as too hoppy, too cloudy, too pricey. Never mind that Mexico’s independent breweries were winning increasing respect. They’ve got plenty of beer, now that restaurants and brewpubs no longer offer dine-in service.

“The outlook is bright for the craft brewers,” Ocampo said. “People will dare to try their beer.”

Consumers are not the only victims of the beer shortage, of course.

Mexico’s beer industry, dominated by Grupo Modelo and Heineken Mexico, generates 55,000 direct jobs, according to the beermakers’ chamber, Cerveceros de Mexico. But counting everyone else involved — barley farmers, restaurants, stores — the number of jobs supported by the industry balloons to 650,000, the chamber says.

“Beer accounts for 25 percent of exports of the agro-industrial sector,” Karla Siqueiros, the head of the chamber, said in an interview. “So we are an agro-industry.”

That argument seemed to win the day with the Agriculture Ministry, which issued a letter on April 6 that appeared to allow beer companies to continue working. But then Mexico’s coronavirus czar, Hugo López-Gatell, got wind of the missive.

“This is an error and will be amended,” he told reporters. The government was permitting only essential activities, he said. “And that doesn’t include the production, the distribution of beer.”

The country has reported more than 27,600 cases of coronavirus and more than 2,700 deaths.

Mexico is the world’s biggest beer exporter, with the United States as its most important foreign customer. Constellation Brands Inc., which has two plants in Mexico producing Corona and Modelo beer for sale north of the border, has continued working, at a reduced level, Bloomberg News reported, citing a spokesman.

The impact on exports is unclear. The company did not respond to an email seeking comment.

Even as domestic beer production has shut down, Mexico’s wine, tequila and mezcal industries have continued to operate.

Paz Austin, the director of the Mexican Council of Winemakers, emphasized the vintners’ farming bona fides. “We are an essential activity,” she said. “We work in the fields.”

But there is little winemaking going on right now, she noted, as vintners await the grape harvest, starting in August. So social distancing is less of an issue — although “we have followed all the protocols.”

The shortage of booze in Mexico isn’t due only to the stalled beer production. A number of local governments have restricted or banned sales of alcoholic beverages. Some don’t want parties at a time when people are supposed to stay home. Others are concerned that liquor in a time of lockdowns will trigger more domestic abuse. Complaints of domestic violence rose about a quarter in March compared to a year earlier, according to official data.

For Erika Anguiano, the resumption of beermaking can’t come soon enough. Her tiny convenience store in Mexico City’s Condesa neighborhood has been out of cerveza for weeks, squeezing her profits.

“The government is punishing us,” grumbled Anguiano, 43. She knows beer is flowing out there somewhere, beyond her reach.

“Look,” she said, tilting her chin toward the street.

A man was walking by with a pushcart stacked with Grupo Modelo boxes. Alberto Hernández, 40, a maintenance worker, said he had found it at a nearby store. He was evasive about exactly where. But he insisted he wasn’t a profiteer. Just someone who liked beer.

Six cases?

“I won’t drink it all in one day,” he retorted, and hurried away.

Gabriela Martinez contributed to this report.