When a global glut drove the price of coffee beans to a historic low five years ago, Julio Flores almost shuttered the hillside coffee farm that had been in his family for four generations. But today Flores's farm is prospering as soaring demand for premium coffee brings new wealth to the old fields of Central America.

"We fought and fought and focused on higher quality, and we have left the crisis behind us," said Flores, 49, wearing jeans and a straw hat as he walked around his leafy, seven-foot-tall coffee plants with beans ripening for a December harvest.

Flores said what saved his farm was a clearer understanding that First World consumers want only the best beans in their cappuccinos and lattes and that they are willing to pay for it.

So he stopped using chemical fertilizers and pesticides, planted avocados below the 4,500-foot elevation that is generally required for the best beans and tended more carefully to his mile-high coffee plants.

Now, instead of selling 100 pounds of beans for $42 as he did in 2000, he is raking in $115 for the same amount of higher quality beans. Better still, he said, if he is certified as an organic grower next year as he expects, he aims to earn $150 to $200.

"A revolution has taken place in five years," said William Hempstead, a director of the Guatemalan National Coffee Association, which has been helping farmers increase quality to further distance themselves from such mass producers of commercial grade coffee as Vietnam.

Industry analysts said the shake-out in the coffee industry has caused pain across the region, resulting in the loss of at least half a million jobs. The industry now employs about 1.2 million people in Central America, down from about 1.7 million five years ago, according to official labor statistics. Guatemala lost 250,000 of its 650,000 coffee-industry jobs.

Unemployed coffee workers have moved to already overburdened cities, and others have gone illegally to the United States looking for work. Families who have depended on coffee for generations have been displaced, and countless coffee farms have been abandoned.

But Hempstead and others said that rather than dying, the industry is now bouncing back with a greater emphasis on top-quality coffee. While that has not restored the industry to its former glory, it has brought rare good economic news to this impoverished region.

Analysts said the shift to high-end coffee had been supported by the United States government, which sees it as an opportunity to improve economic stability in its back yard. Conservation groups also are working with farmers to help them earn more money so that coffee farms survive, because they help the environment by preventing erosion and harboring wildlife.

Large U.S. coffee corporations, Central American governments, U.S. aid agencies and international conservation groups are working together to help the industry, said Charles Oberbeck, who is in charge of the region's coffee programs for the U.S. Agency for International Development.

"The unlikely bedfellows," he said, may all be working for differing reasons, but the effect is clear: Guatemala's coffee export earnings rose from $233 million two years ago to over $300 million this year. A similar rebound is occurring in neighboring Costa Rica, El Salvador, Nicaragua and Honduras, which all depend on coffee production.

"The crisis taught us that quality sells," said Henry Hueck, a Nicaraguan coffee farmer who sells his coffee to Bewley's Ltd., based in Ireland. "It used to be a given that people bought your coffee. Now all people are talking about is quality coffee."

Oberbeck said U.S. coffee companies are paying above-market prices to secure the world's best coffee because "they don't want to kill the goose that laid the golden egg."

While there is a huge supply of commercial-grade coffee -- often grown in the sun in lowlands in Africa and Asia and Brazil -- Oberbeck said there is a less abundant supply of what is considered the best coffee. He said the growing demand for top-quality coffee has turned out to be "lucky salvation for the industry" in Central America. Guatemala in particular is reaping the benefits as it emerges "as the world leader in quality coffee," he said.

According to industry figures, Guatemala ranks second to Colombia in the overall amount of quality coffee it produces, but ranks first in the percentage of its crop classified as the highest quality -- and that percentage has been rising steadily.

Guatemala's elevation, volcanic soil and rainfall produce beans with distinct flavors -- from chocolaty to fruity -- setting it apart from coffees used in canned or instant coffee, industry experts said. Some Guatemalan coffee is grown at elevations as high as 11,000 feet, with farmers tending to it on mountains so steep they have to tie a rope around their waists to make sure they don't fall. "It's so steep you can literally fall out of your farm," Oberbeck said.

Coffee experts compare their industry to the wine industry, with consumers wanting a gourmet arabica more than a routine robusta, just as people want a fine cabernet sauvignon over a red table wine.

There has also been a noticeable upsurge in Japanese buyers, including the giant beverage company Suntory, which has descended on Guatemala looking for velvety bodies, lively aromas and just the right aftertaste. Japan, once a tea-drinking nation, is now the third-largest importer of coffee, after the United States and Germany, according to the International Coffee Organization.

The competition among buyers from wealthy countries is also helping coffee producers in Costa Rica, El Salvador, Nicaragua, Honduras and the southern Mexican state of Chiapas.

New Internet auctions begun this year exclusively for the region's gourmet coffee attracted bidders from New York to Tokyo and are helping raise prices and recognition in Central America.

The U.S. government has allocated nearly $20 million for regional coffee programs to be spent through USAID from 2002 to 2006. The agency is helping farmers with technical and marketing advice. U.S. officials said supporting the coffee industry makes sense because coffee remains a vital export and employs hundreds of thousands of the region's poorest.

When things go wrong in those fields, "we really feel the effect in our back yard," said Martin Raine, a U.S. economist at the World Bank who focuses on Central America. Environmental and conservation groups have become involved in the shade-grown coffee movement, praising small farms such as Flores's for the steps they have taken to protect the environment.

"We call them coffee forests because so many of them are so gorgeous," said Sabrina Vigilante, a marketing manager for Rainforest Alliance, a New York-based organization.

On the steep road to Flores's farm, named The Forest, he points out one abandoned coffee farm and another paved over for a new housing development. But at his place, mockingbirds, doves and parakeets fly under a canopy of cypresses and cedars. He said he has planted 4,000 trees on his 400 acres, all part of a strategy to become certified as organic and environmentally friendly.

Flores also said he now likes drinking specialty coffees, such as cappuccino, a drink that many of his beans are used for in the United States. He has even asked his aunt in Bethesda, Graciela Carcamo Stukey, to bring him an espresso machine on her next visit.

Coffee workers earn about $4 day -- the price of some brews at U.S. coffee shops. Farmers and workers interviewed said that working conditions have improved in many cases as foreign buyers, who want to be seen as socially responsible, express concern.

Flores said he is planning a new health clinic on his farm, adding that producing better beans means more profit for him and higher pay for his workers.

"I benefit and so do my workers," he said. Flores even said he is hiring, rare good news in an industry that has been shedding workers.

Rosendo Tubac, 32, said he was jobless for two rough years when the coffee farm where he worked went out of business. He said he and his wife scrambled to sell sandwiches in the street to feed their four small children.

Now, working at The Forest, Tubac said, "times are better."

Five years ago, low coffee prices almost forced Julio Flores to sell his farm. Now he's prospering by selling high-end beans.Farmer Julio Flores, left, has been hiring workers such as Rosendo Tubac, who was unemployed for two years after the farm where he used to work went under.