Five years ago, Rick Swanson was ready to bulldoze his 800 acres of almond trees because prices seemed stuck in a perpetual rut.

These days, Swanson is thankful that he exercised restraint. Almonds are so hot that California farmers are ripping up apricot orchards and vineyards to plant almond trees.

"Thank God for Atkins!" Swanson said, referring to the popular low-carbohydrate diet plan. "It's the greatest food they have as a snack. I believe that's why we are thriving today."

Besides being championed by trendy diets, almonds have benefited from increasing awareness of their health attributes, a savvy marketing campaign and growing global demand. Last year, almond exports topped $1 billion for the first time, and industry experts predict robust growth, in the United States and abroad, for the foreseeable future.

"It's a great success story in American agriculture," said Frank Tarrant, director of the Horticultural and Tropical Products Division at the U.S. Department of Agriculture.

What makes the success of almonds even more remarkable is that it comes at a time when many other crops in California and elsewhere in the United States are being battered by everything from changing consumer tastes to inexpensive foreign imports.

A bacterial disease called citrus canker has nearly destroyed Florida's lime industry. Apple farmers are being bruised by competition from China. Potato farmers are suffering because of low-carb diets. And the tobacco business is shrinking because Americans are not smoking as much.

The winners and losers of American agriculture are detailed in the fine print of the recently released Census of Agriculture, a publication the size of a New York City phone book that is released every five years by the USDA and provides a snapshot of what is happening on American farms.

The census chronicles the steady reduction in the number of American farmers and also settles such contentious questions as the location of the popcorn capital of the nation. Marion, Ohio, and North Loup, Neb., both claim the title, but the census shows that neither deserves it. Mason County, Ill., produces more popcorn than any other place.

On a much broader scale, the latest census, covering 1997-2002, shows that the overall value of agricultural products nationwide declined by less than 1 percent during that five-year period.

Based on total sales, California is by far the nation's largest agricultural state, with $26 billion in annual sales.

The changing dynamics of American agriculture are evident in the fertile farmland near Modesto, Calif., where Mediterranean-like weather creates a perfect place for a variety of crops, among them almonds and apricots. But where almond growers are enjoying the perks of unprecedented growth, apricot farmers are struggling to stay afloat.

According to the agricultural census, the number of acres planted with apricot trees declined by 37 percent from 1997 to 2002, while almond orchards grew by 23 percent.

In Westley, Calif., Ivan "Gene" Bays, the chairman of the Apricot Producers of California, said he is tearing out apricot trees and replanting with almond trees, "about the only commodity that's expanding right now."

Bays, 77, said a flood of inexpensive imports from Turkey, where land and labor are far less costly, has decimated California's apricot industry.

"They're killing us," said Bays, who has reduced his acres of apricots from a high of 1,000 to 375. "They're putting us all out of business. . . . Turkey can bring the dried apricots in here for under $2 a pound. For us, it costs $4, $5, $6."

As a result of California's competitive disadvantage, most apricot farmers have reduced their acreage or gotten out of apricots altogether, said Shane Donlon, a real estate broker in Patterson, Calif., and a part-time farmer.

Two years ago, Donlon said he, too, pulled his apricot trees and is planning to plant almond trees.

"I lost an entire crop because no one would buy them at all," he said. "It's pretty brutal."

California's almond industry has virtually no foreign competition, and farmers have seen prices increase even as production has soared, a rare event in agriculture.

"Almonds did something you never see in farming -- production is going up, and so are prices," said Jeff Lee, 45, a fourth-generation farmer in Modesto, Calif.

Part of the reason for the almond's success is evident among Lee's neat rows of almond trees. Unlike apricots, which require handpicking, almonds are harvested entirely by machines that shake the nuts from the trees and vacuum them off the ground, considerably reducing overall costs.

"It costs 50 cents to shake a tree," said Lee. "To do it by hand, it's $2." Like other farmers, Lee pronounces "almond" as "amond," the local joke being that they shook the "L" out of the word.

Another reason is that almonds, and other nuts, have been blessed by nutrition experts and diet plans as a nearly perfect snack because they are low in carbohydrates and are a good source of protein, vitamin E and monounsaturated fat, the so-called good fat.

Last year, the U.S. Food and Drug Administration allowed most nut manufacturers to make a qualified health claim on their packages that eating nuts "may reduce the risk of heart disease."

The health claim will be added to packages of Blue Diamond almonds in October, said John O'Shaughnessy, director of the consumer division for Blue Diamond Growers, a cooperative that represents two-thirds of U.S. almond farmers.

As part of an effort to market almonds as an alternative to more traditional, and less healthful, snacks such as potato chips, Blue Diamond is running promotions with the National Football League and NASCAR, he said.

"You can have [almonds] with a beer or a bottle of water," said O'Shaughnessy, who says Blue Diamond will soon introduce almonds flavored with wasabi, jalapeno and "lime n' chili." "There's nothing else like it. . . . It's the health food for couch potatoes."

While the health claims and new flavors should boost U.S. consumption, most California almonds -- nearly three-quarters of the crop -- are sold abroad, with Spain, Germany, Japan and India as the biggest customers. And as foreign markets grow, California, which produces 88 percent of the world's almonds, has few competitors for the new business.

But the success of almonds may be their undoing. Investors in China are reportedly testing ground for almond production, and more and more California farmers are replacing apricots, cotton and grapes with almonds, industry officials said.

"One thing you know in agriculture is don't set your sail on one thing because it won't last," said Swanson, 59, the almond farmer, who also operates a grain elevator that supplies feed to local dairies. "Like everything else, we will overdo it.

"We're going to drown in almonds before it's all said and done."