SANTA ANA ZEGACHE, Mexico — In the birthplace of maize, nobody seemed to need Juan Velasco’s crop.

For a few years, he was unable to sell half of the nutty, orange-colored cobs that he harvested. There is no farmers’ market in this dirt-road village in the central plains of Oaxaca, and middlemen offered such low prices that it made more sense to feed the corn to his sheep.

So two years ago, Velasco, 46, sold half his land, cutting his holdings to 8 acres.

“It was a lot of work, and for what?” he said, tearing maize, or corn, from ragged stems growing between rows of pumpkins one winter afternoon. “You invest, and you don’t make money.”

Now, though, Velasco says he plans to expand to meet demand from an unexpected source. In New York, Los Angeles and beyond, a taste for high-quality Mexican food and its earthy centerpiece, the handmade tortilla, has created a small but growing market for the native, or landrace, corn that is central to life in these plains and to Mexican identity.

Santa Ana Zegache, a Zapotec community of about 3,000, is a grid of quiet streets and adobe compounds known for its pugnacious residents and elaborate 17th-century church.

Farmers here grow dark-yellow, white and burgundy corn on small plots, much as they have since the plant was domesticated in Mexico thousands of years ago. They eat part of what they grow and sell the rest, keeping the seeds for the next season.

“Corn is in our roots,” said Lorenzo Gaspar Montes, 50, a police officer who farms 7 acres in Santa Ana, citing the Mayan myth in which deities created humans from corn.

Mexico grows some 59 varieties of corn and consumes more of the grain per capita than almost anywhere on Earth.

“It’s in every dish we make,” Montes added.

The appetite for native maize offers hope to smallholders who have been hammered over the past 20 years by competition from cheap American corn and could save varieties that would otherwise disappear as farmers put down their tools and take off to El Norte.

Hundreds of thousands of small growers have given up their farms over the past two decades, after a government program to support prices ended, subsidies targeted larger farms, and free trade with the United States drove down corn prices. Mexico imports about 10 million tons of corn from the United States a year, nearly a third of what it consumes.

Nearly half of Santa Ana’s men are working in the United States, residents estimated; many of those who stayed behind became police officers in Oaxaca City, 20 miles north. By day, the village is sleepy: a group of children playing basketball in the main square; a barefoot grandmother shooing a dog from her gate.

After losing so much to the United States, said Velasco, the farmer, “It makes us very proud that someone from abroad wants to eat our corn.”

Mexican cuisine — of the black-kingfish-with-pineapple-purée-and-cilantro variety, not the burrito variety — has become de rigueur in the past couple of years as top chefs have opened Mexican restaurants and taco joints in the United States and Europe.

Chefs buy native corn from Mexico and grind it in-house to make masa, or dough, for tortillas, tamales, tlacoyos and tetelas — a trend that is also growing in Mexico. There seems to be no more coveted addition to a restaurant kitchen these days than a hulking metal mill for grinding corn softened with ash or slaked lime.

Daniela Soto-Innes, chef de cuisine at Cosme, Enrique Olvera’s Mexican eatery in the Flatiron district of New York, said she often talked with American chefs about which maize they preferred — Cónico? Bolita? Chalqueño? — a conversation that would have been “unimaginable” a few years ago.

Cosme imports its corn from Masienda, a California-based company selling Mexican corn. It was founded in 2014 by Jorge Gaviria, a former chef who got the farm-to-table bug during a stint on an organic pig farm in Tuscany.

Gaviria, who darts around the Mexican countryside buying corn in batches as small as 100 kilos, has about 100 clients in the United States and Europe, making him the dominant player on a very small field. The company expects to import 400 tons of corn this year, up from 80 tons in 2015, and plans to open tortillerías on the East and West Coasts of the United States.

“If corn really takes off, you could get a repeat of the quinoa story,” said Gaviria, referring to the sudden popularity of the Andean grain, as his taxi bumped along a pitted road to Velasco’s farm outside Santa Ana.

Velasco, who harvested about 6 tons of corn last year, sold half to Masienda, for about 60 cents a kilo. He kept a ton to feed his family and sold the rest to local consumers for around 50 cents a kilo. Gaspar, the police officer, sold Masienda 1 ton of corn.

This year, Velasco will rent more land and sell everything to Masienda — other than what his family eats. The price was less important than the fact that “Jorge buys the lot,” he said.

Martha Willcox, a geneticist at the International Maize and Wheat Improvement Center near Mexico City, said she hoped that demand for landrace corn would give some young people a reason to farm rather than to emigrate.

“If each of these guys reaches 70 and their kids are in the United States, this ends,” said Willcox, gesturing to workers sorting pink cobs of a rare strain, belatove, into neat piles.

Gaviria is collaborating with Willcox and Flavio Aragón Cuevas, a local geneticist, to improve landrace strains and increase the production of varieties that are at risk of dying out because too few people are planting them.

Luis Herrera Estrella, the director of the National Laboratory of Genomics for Biodiversity in Guanajuato state, said that the gourmet maize market had the potential to provide a livelihood for, say, 20 percent of smallholders.

However, the only way to make most farms viable, he said, was to introduce more technology, including transgenic corn — a highly sensitive issue in Mexico, where planting genetically modified corn is banned. If farmers could not raise their yield above 1 ton per acre — a quarter of the yield of commercial producers in the United States — more of them would give up, he said.

“We should try to sustain this way of life and this way of farming using all of the technology at our disposal,” Herrera said.

If demand continues to grow, there could be risks, experts said. Local consumers could be priced out, as happened with quinoa. Farmers could sell their entire crop, and keep none to eat.

“If it just becomes about demand, it will ruin everything,” said Amado Ramírez, an agricultural engineer based in Oaxaca City whose project, Itanoni, works with corn farmers to improve yields and methods.

Ramirez, who said he sold corn to a gourmet taco stand in Copenhagen, Hija de Sanchez, said urbanites could disrupt an ancient farming system whose value was “cultural, spiritual, economic and ecological.”

Gaviria said Masienda buys only the surplus production of farmers after they have put aside corn for their families.

“It’s a subsistence crop, not a cash crop,” he said.

In Santa Ana Zegache, the farmers do not seem to think that their lives will be turned upside down by three-star chefs in Manhattan. Velasco said he was just glad to have his crop eaten by humans rather than sheep.

Plus, he said, “We’re happy to make some money.”