SAN PEDRO EL ALTO, Mexico — The message blared from a pickup truck with a megaphone attached to the roof: Coronavirus vaccine had arrived in this tiny, Indigenous town in the hills of central Mexico.

Villagers stopped what they were doing to listen. How could San Pedro, where nothing ever seemed to happen, become one of the first places in Latin America to vaccinate its residents?

“I thought it must be a lie or a joke,” said Ubaldo Sánchez, 61, who walked off his cornfield, confused and ecstatic, when his daughter ran up to him, shouting the news.

As debate rages around the world about who should be vaccinated first, Mexico has come up with its own unconventional approach — one with no apparent epidemiological foundation. The government of populist president Andrés Manuel López Obrador, who campaigned on the slogan “First, the poor,” is prioritizing the country’s most disadvantaged citizens, using the vaccine as a kind of reparation for years of marginalization.

Teachers in rural villages, some of the country’s poorest farmers, elderly members of far-flung Indigenous communities: They will receive coronavirus vaccinations before almost any of Mexico’s city-dwellers, who have endured the worst outbreaks. In many cases, the rural poor have been vaccinated even before the medical personnel in charge of administering the shots.

It’s an approach that López Obrador’s supporters embrace — proof that their president is on the right side of Mexico’s profound class divide. But to many public health professionals, it is scientifically irrational, evidence that politics are distorting the vaccination drive. Most of the communities being prioritized have had relatively low coronavirus caseloads. Most are rural or semirural towns, where social distancing was never a challenge.

“This is a vision that has no basis in epidemiology,” said Fernando Petersen Aranguren, the secretary of health in Jalisco state. “This has nothing to do with public health and doesn’t focus on the need to break the chain of contagion.”

Aranguren wanted to distribute doses in Guadalajara, Mexico’s second-largest city, where more than 71,000 people have been infected with the virus. But the federal government, which has near-total control over vaccine procurement and distribution, instead gave him a list of small towns and villages it told him to prioritize.

“Beginning in major cities with larger outbreaks would have allowed us to reduce our caseload much more effectively,” Aranguren said.

This week in San Pedro el Alto, population 3,500, residents older than 60, many in colorful traditional dress, lined up outside the town’s tiny public health outpost. Federico Hass, 63, with a long, white beard down to his chest, rolled up a sleeve for his shot.

“It’s proof that, for our president, wealth doesn’t matter. He’s sending a message to everyone,” he said. “This isn’t like the United States. This isn’t like Europe.”

But in the government’s rush to get doses to the poor, many of the nurses and doctors in charge of the vaccination program — including the ones who attended to Hass — had not yet been vaccinated themselves.

“It’s scary to be here, so exposed, without getting the vaccine, but what can we do?” said Silvia Garcia, one of the nurses assigned to San Pedro. “We can’t refuse to work.”

López Obrador has refused to be vaccinated until doses are made available in his Mexico City district. Critics have called the decision a theatrical show of humility. While waiting for the vaccine, López Obrador contracted the virus in January. The country’s coronavirus czar, Hugo López-Gatell, fell sick this month.

Mexico has reported more than 2 million coronavirus cases and over 183,000 deaths, both considered undercounts. The most severe outbreaks have been in large cities. Mexico City, according to one study, has suffered the worst urban outbreak in the world.

Although some of the hardest-hit areas have been working-class ­urban neighborhoods, Mexicans have watched the pandemic march across the economic divide. Last month, Carlos Slim, Latin America’s wealthiest man, was infected in Mexico City.

Mexico’s government has provided little economic assistance to the country’s poor during the pandemic, even as unemployment has surged. Yet López Obrador’s approval ratings, in several polls, remain over 60 percent — proof, some analysts say, of his political mastery.

Many of López Obrador’s followers come from the country’s poorest communities, traditionally neglected by the country’s political elite. They are fiercely loyal to the president, who frames his social policies as a historic effort at narrowing the nation’s stark inequalities. Even a vaccination campaign is an opportunity to showcase his progressive bona fides.

The federal government has taken control of the vaccination program, choosing which municipalities are prioritized, deploying military units and dispatching doctors, nurses and federal officials as part of vaccination “brigades” in an extensive ground operation.

This month, the government released a list of 333 “highly marginalized” municipalities that would receive the first doses.

“We are merely starting in the most remote communities, where there are more needs and also where there is not enough health infrastructure to deal with covid cases,” López Obrador told reporters. He dismissed the idea that he was using vaccines for political ends: “It’s offensive.”

Twenty-four of the 333 municipalities, as well as San Pedro el Alto, are in Mexico state. Most are remote and rural — they lie along the winding, narrow roads that climb through the hills of the state. The municipality of San Felipe, where San Pedro is located, has seen 392 coronavirus cases out of a population of 121,000.

The state health department has questioned the federal government’s approach there, too.

“Although we have been very respectful of the government’s decision, in my opinion we should be prioritizing other subgroups of people at risk, like, for example, those with preexisting medical conditions and comorbidities, instead of focusing on geographical criteria,” said Gabriel O’Shea, the state health minister.

Last month, the government began vaccinating thousands of teachers in Campeche, one of Mexico’s poorest states. Health workers poured into the streets to protest the decision, complaining that many nurses and doctors had not yet been given their shots.

Next up are the teachers of Chiapas, Mexico’s poorest state. Chiapas and Campeche both have midterm elections this year, considered a critical test for López Obrador’s Morena party — a link frequently drawn by critics.

In some countries, residents of small towns are expected to travel to the nearest urban center to be vaccinated. In Mexico, the opposite is happening: Some people have begun to drive from major cities to the tiny marginalized towns prioritized by the federal government. Some are being turned away. But in San Pedro el Alto this week, they were allowed in.

Carlos Vilachis, a merchant from Toluca, the state capital, traveled to several prioritized rural communities before he found a spot in San Pedro el Alto. He was grateful for the vaccine but criticized the approach that left him unable to get it in his city, one of the largest in the state.

“I understand and applaud that they are giving it to those who have no access to medical services in these communities,” he said. “But they should not disregard the big cities, where there are a lot more cases.”

Public health analysts outside the government agree.

“The rationale is: ‘We are doing it this way because it is time to make justice,’ ” said Xavier Tello, a health policy analyst in Mexico City. “The problem is that the government has not shown any evidence that supports the epidemiological calculus behind this decision. They have not shown any evidence of higher mortality rates in those places, and so they are wasting vaccines and diverting them from places where they are more needed.”

Even in San Pedro, pride that the town had been chosen as a vaccination destination quickly devolved into anger. So many people had arrived from neighboring municipalities that health workers quickly ran out of doses.

On Tuesday morning, a few hundred people gathered in the central plaza. Many of them had traveled across the state the night before and slept on the ground in hope of securing a place in line. Soon, they were informed that there were no doses left for them.

Moisés García Sánchez, a retired lawyer wearing a cowboy hat, who had arrived at 4 a.m. from a nearby town, said he was furious and disappointed about making the trip after getting his hopes up.

“The president is supposed to help us and now they leave us out in the cold for nothing?” he said. “‘First, the poor’? First the poor to step on, is what he really means. It’s just a political slogan for him.”

“Now, we will never be able to get the vaccine,” he muttered angrily.