You can tell by the quiet smile on his face that Bonifacio Cruz Ruiz is proud of his agave plants.
Inside a small handmade greenhouse in his backyard, Ruiz has thousands of plants growing on shelves lined with baking sheets. Each sheet contains hundreds of small seedlings that will one day grow into massive plants weighing hundreds of pounds. Bonifacio carries the trays with care, as if they hold his children, and in a way, they do.
The backyard nursery is the result of Ruiz’s work with nonprofit Heifer International, through its pilot program in Oaxaca, Mexico, Heifer’s first involving mezcal. The organization, which typically shares livestock such as chickens and goats with people in underdeveloped areas, came to Ruiz’s town and helped him and other residents build greenhouses for agave plants, showing them how to maintain those plants. Recently Ruiz was able to take things a step further and pass the gift along by sharing some of his beautiful seedlings, as well as directions on how to care for them, with neighboring villagers so they could do the same.
After he delicately puts the tray back in its resting place, Ruiz leads me and a small group of Heifer employees down a slightly treacherous path roughly a half a mile behind his home. The journey takes us up and down hills and across a small river to a small garden, where he transplants the seedlings once they’ve outgrown their baking-tray beginnings. You can tell by looking at his face that he’s proud of what he’s accomplished and what the future might hold.
In the town of Santa Ana del Rio, there’s a saying: “Para todo mal, mezcal. Y para todo bien, tambien.” Translation: “For everything bad, mezcal. And for everything good, too.” It’s a saying best accompanied with a glass of the local spirit in your hand and commemorates a liquid that is used in the area for everything from an afternoon drink to a folk remedy to cure illnesses.
Mezcal has been an integral part of the local community for generations. However, families in the isolated town—which has exceptionally limited access to basic utilities like running water and electricity—have had trouble making the spirit a commercial success. They’ve also run into trouble keeping the tradition going, as younger members of the community tend to leave the area, seeking greater job opportunities. Many ultimately choose to immigrate to the United States.
The agave used to make mezcal in the village has traditionally been harvested from wild plants. However, when something happened to those plants, the village was forced to buy them from other villages, cutting into their already meager profits. Wild agave can also be hard to find, making the process of collecting enough for a batch of mezcal a rather time-consuming task.
Now, thanks to Heifer, that agave Ruiz is growing will ensure the area has not only a steady supply of the plant, but also that they’ll be able to locate them quickly.
In 2017, Ruiz along with other members of the village voted to sell their mezcal to Pernod Ricard, which is working with Heifer on the program, after a representative from the brand visited the area. The plan at the time was to ultimately integrate mezcal from the village into the company’s popular Del Maguey brand. That hasn’t happened just yet, but Pernod is consistently purchasing the mezcal and storing it with plans to release it in future.
Even without the official release, that partnership has fueled some tremendous results. Whereas the town once sold its mezcal for just eight pesos a liter (approximately 50¢), it’s now approaching 130 pesos per liter ($7.50), a significant improvement. The villagers are also selling more. Prior to Heifer and Pernod’s involvement, the Rodriguez family typically sold around 400 liters of mezcal per year. Now that number is closer to 1,000 liters.
Heifer wants to help facilitate that growth, making the industry more sustainable for a community where the average annual family income is between $3,000 and $5,000. Now the community is making a consistent product and is aware of the spirit’s market value.
Beyond teaching Ruiz and others how to build greenhouses and nurture seedlings, the group also helps local farmers learn skills such as how to prevent pests from destroying the plants, which can often take five to seven years to reach maturity, and how to care for and prevent diseases in their livestock, which are often used to harvest those heavy plants on the steep hills where they grow.
Ciro Rodriguez is one of the people responsible for harvesting agave in the village. Each day he, along with his two sons, labors in the sweltering sun, harvesting the agave plants, which can often weigh hundreds of pounds, and then cutting off their tough leaves with machetes before carrying the heart of the plant—the piña—back to their family’s outdoor distillery, called a palenque, to be turned into mezcal.
It’s exceptionally hot, laborious work, even for an onlooker who isn’t actually wielding any tools or bearing any heavy loads. Plants often grow on steep, hard-to-navigate inclines, and they’re carried up or down these dusty hills, strapped to the back of the family’s donkeys.
“Heifer has provided us with vaccines for horses, mules, and donkeys,” Rodriguez says. “That has helped us a lot.”
Once the agave is harvested, a process that’s done by hand one plant at a time, the piñas are eventually loaded into the family’s truck and then driven back into town.
In town, the plants are placed in a large dirt pit filled with hot stones. Dirt is put on top, and the plants are cooked for roughly a week. Afterward, those piñas are manually pressed, and the fibers are placed in small stills where they’re distilled into mezcal.
It’s a long process. And all these tasks are also performed outdoors in temperatures topping 100 degrees, making an already laborious process even more so. It’s also done in very much the same way it always has been from generation to generation in the village.
For now, that mezcal is only sold in bulk, and what is sold is made in a way that it meets quality standards Pernod has set in place. “If we wanted to bottle the mezcal that would mean a lot of money to pay to the authorities and to get permission,” Rodriguez says. Liquor sales in Mexico have high taxes, sometimes near 60%, which can make it hard to market the product in accordance with the law.
Now that the village, and its mezcal production, can provide a living wage for its residents, the hope is that more of them will choose to stay in the area and keep those traditions going well into the future—and potentially grow the business further.
“Continue getting ahead. That is what we’re looking for right now,” Rodriguez says. “We would like the mezcal production to thrive. We used to plant agave and make mezcal just because, without seeing any improvement or progress. Now what we want is to have a brand of our own.”
More must-read stories from Fortune:
—Germany might be producing the best Pinot Noir available today
—This restaurateur traded fine dining for Ben Franklin’s favorite milk cocktail
—Bar carts are back: How this revival is different
—5 Irish whiskey brands you need to try now
—How this 24-year-old entrepreneur is updating the biergarten experience
Follow Fortune on Flipboard to stay up-to-date on the latest news and analysis.