For much of the past decade, the international dairy market did right by Tim Leary, creating opportunity for his farm in southern Maine by linking his fortunes with ever-wealthier Asian milk drinkers. But the downside of this globalizing dairy market revealed itself this month, when Leary watched a livestock hauler whisk away 21 of his cows, destined to be milked the next morning at someone else’s facility.

The 56-year-old Leary had abandoned the business he inherited from his father, who at 85 had lived long enough to witness what low milk prices and had wrought on the family patrimony.

“It was an agonizing decision,” Leary said.

There is, dairy farmers are finding, no hiding from the global free market once you embrace it, which U.S. dairy producers did over the past decade after 50 years defined largely by a mixture of government subsidies and protected markets. Slowing growth in China, plentiful production in New Zealand, trade sanctions imposed by Russia and the end of European production restraints have driven down the price of milk that farmers like Leary receive.

They now face a slow, painful retrenchment, one that government subsidies probably won’t ease, despite political pressure to do so. More agonizing decisions of the sort Leary faced are coming. Many dairy cows will go to slaughter or join much larger herds before supply and demand sync up and prices stabilize.

“It’s not like flipping a switch on a factory production line,” said Alan Levitt, a vice president with the U.S. Dairy Export Council, a Washington-based trade association. “This is going to have to run its course in the international market.”

For the past 10 years -- and for the first peacetime period since the modern agriculture policy kicked in during the Great Depression -- growth for U.S. dairy farmers came mainly from exports, which accounted for about only 4 percent of production 10 years ago. By 2014, after growing 17 percent per year for a decade, exports made up 14 percent of total production, according to the export council. Brisk growth in Asia, above all in China, underpinned strong global demand for well-known dairy products like cheese, butter and yogurt but also items that seldom appear on grocery shelves, such as whey protein and specialized milk powder.

Those days have ended. Through July, U.S. dairy exports were down 33 percent by value compared with a year ago, and 13 percent by volume, according to the council. The price of whole milk powder, which peaked in February 2014 at over $5,000 per metric ton, hasn’t been above $3,000 for nearly a year, and in mid-September stood at $2,175, according the U.S. Department of Agriculture.

When U.S. dairy farms threw themselves wholeheartedly into overseas markets, they changed the rules of the game in bad times as well as good ones, largely because milk can become a multitude of products. And cows produce it every single day, whether it’s wanted or not.

Markets for fresh fluid milk are largely local or regional in the United States -- and even in modest-sized countries -- because moving it quickly by air is far too expensive, while transporting it very far on the ground risks spoilage. The market doesn’t grow quickly, but doesn’t generally contract rapidly either. However, many products derived from milk, notably dried milk powder and whey, last plenty long to be exported over large distances. Other products like butter are often national markets because high tariffs keep domestic prices higher than they otherwise would be.

Since about 2004, with the exception of a sharp global downturn in 2009, milk prices rose steadily on the strength of rising demand -- prosperous people invariably have better diets -- in China, and more U.S. milk production headed overseas, by way of the processing plant. Companies joined the Dairy Export Council in droves.

“We saw a lot more companies broadening their portfolio to include products not historically made in the United States for which there’s a demand overseas,” said Robert Wellington, chief economist at Agri-Mark, a dairy farmer cooperative in Lawrence, Massachusetts.

Nonfat milk powder was high on the list. It used to be a bulk commodity that U.S. processors sold to cheesemakers to fortify their product. Globally, it has many more uses, such as hot cocoa mixes, ice creams and protein-rich sports drinks. And when Chinese infant formula manipulated with additives sickened thousands and killed a small number of babies in 2008, demand rose for more reliable imported product. American producers invested in the equipment to supply the Chinese, and the virtuous cycle continued.

Big U.S. producers such as California Dairies Inc. profited directly, while farmers like Tim Leary got used to the higher milk prices that were the upstream effect of Asian demand for powder.

“When you start hearing about the opportunities to export you think ‘hey, great,’ ” Leary said.

In fact, he never actually shipped product overseas, he only shared the prosperity -- and then the pain.

RTR3182B A dairy cow peers out from behind a fence in Chino, California. Photo: Reuters

The Leary farm, a short drive from Maine’s Atlantic coastline in the small town of Saco, is very much a family matter. It’s tucked into an urbanizing part of Maine, where land sells for new homes or commercial development, not farming. Tim Leary’s father started working on it at age 13. Tim’s daughter, Alison -- one of eight children -- has plans to take over the farm, and is engaged to a man whose family runs a butter farm. They have various ideas for how to tap the growing market for artisanal foods, and one idea of what not to do.

“They do not want to make a business model based on the wholesale price of milk,” Leary said.

That business model died -- and with it Saco’s last dairy farm -- in early September, as the smallest producers felt the effects of softening demand. In the last 18 months, Maine lost about 60 dairy farms, leaving 253 in the state today.

The proximate event for Leary’s decision wasn’t actually a new low in the price of milk. It was the loss of his hauler, who drove a large milk truck to the Leary farm each day. He abandoned the run because the decline in dairy farming in southern Maine meant a truck that can haul 65,000 pounds of milk carried only about 13,000 from the remaining five farms in the area, Leary said. Transport costs alone made the route a loser.

Leary had two weeks to find a way out. He talked to a local cattle dealer, who picked up the animals the following day, leaving only a few cows for raw milk cheese production, an artisanal business offering more profit potential than supplying milk drinkers.

“We didn’t just watch margins shrink,” Leary said. “We watched them vanish.”

Julie-Marie Bickford, executive director of the Maine Dairy Industry Association, said the second-order effects of low milk prices are now wreaking havoc with the state’s small-farm dairy ecosystem. “The financial pressure has moved from the dairy farm to the infrastructure,” Bickford said.

It’s not only haulers in southern Maine. Veterinarians have fewer cows to vaccinate and treat. Milking equipment dealers aren’t doing much business, and feed companies aren’t getting as many orders. Farmers aren’t buying sawdust, used for bedding, from local lumber mills.

In the United States and Europe, dairy farmers have traditionally turned to the government for help, resulting in lakes of milk and mountains of butter stockpiled to boost prices, or taxpayer outlays to ease financial pain. That’s not panning out during the first downturn for a newly globalized U.S. industry.

Dairy farmers helped fight for, and won in the 2014 federal farm bill, a government system for insulating against downturns, known as the Margin Protection Program. Essentially an insurance scheme, the program compensates farmers when their costs exceed their income, and the Department of Agriculture exhorted farmers to enroll in it for this crop year. Most did.

By midyear, federal officials were dialing back expectations for the program’s ability to cushion against a prolonged downturn of this magnitude. Krysta Harden, the deputy secretary of agriculture, said during a visit to southern Maine that dairy farms “need to be running their own numbers” and figuring out whether the program makes sense for them.

“It will never make anybody completely whole,” Harden told the Portland Press Herald. “That’s not the purpose of it. It is to help them to continue to survive throughout the producing season and year so they can continue to stay on their dairy farms.”

To Maine farmers, the program has so far proved to be “Band-Aids on open, gaping wounds,” said Bickford, the association president. The insurance assumes a level and duration of low prices that the global market has blown through against all expectations. Without a midcourse correction -- and New England dairy farmers have lobbied for changes -- the program won’t matter.

Rep. Chellie Pingree, a Democrat who represents southern Maine in Congress, has called on the agriculture department to change the way it pays out the insurance to take account of higher costs in the region. Maine farmers pay more for feed than, say, farmers in Nebraska because grain isn’t as available locally. Costs “just aren’t being calculated accurately for farmers in some states,” Pingree said in an email.

The best prospect for Tim Leary at the moment has nothing to do with cows. He has 40 acres of squash, green peppers, cucumbers, cabbage and other vegetables planted, and agreements to sell to a distributor that sells to 170 stores in northern New England, the Hannaford Brothers Co. But he won’t escape the globalizing food market.

Since 2000, the owner of Hannaford has been the Delhaize Group, a Belgian multinational that operates stores in seven countries on three continents.