Three days a week, Scott Hertzberg is a bureaucrat saddled to his swivel chair. He exerts himself by pushing a computer mouse inside a cramped cubicle, breathing recycled air.

The 34-year-old librarian does Internet research for the Department of Justice -- not a miserable job, but hardly the stuff of his dreams.

"You just have no control," he said. "There are five or six people involved in a decision to move a filing cabinet across the floor. And that could take six weeks or six months to do, if it even happens. It drives you crazy."

On his two weekdays off and on weekends, Hertzberg escapes to nine acres in southern Prince George's County, where the air smells like freshly cut grass. It has been three years since he and his wife, Tanya, who works full time for the Sierra Club, moved out of the house they rented in Takoma Park. They paid $240,000 for the land, a white Cape Cod-style home and a weathered tobacco barn and became part-time farmers.

Hertzberg considers himself part environmentalist, part "agrarian romantic" -- an admirer of the scrappy, independent life of his great-grandfather, a fruit peddler in Upstate New York. The work is physical. He trudges at dawn through muddy soil and rakes weeds with a stirrup hoe. Yet the rewards are immediate, he said, found in a patch of ripening eggplant or in a handful of cash fresh from the farmers market.

"It's primitive, and it's definitely not lucrative, but it's yours," he said. "Now I can say, 'I'm going to plant a row of peppers. I'm going to sell them to people in Bowie. I'm going to make that decision myself. Nobody can stop me.' "

In what remains of the rural landscape surrounding the District, the Hertzbergs are among the urban exiles who have found second careers working the earth, giving up collared shirts for overalls.

But to make a living as a farmer these days is to buck an ominous trend. The numbers of farms and acres of farmland in the region continue to fall. According to the most recent agricultural census, Maryland lost 1,056 farms from 1997 to 2002, an 8 percent drop. Virginia lost 1,760 farms, a 4 percent decline.

In Southern Maryland, in particular, the face of agriculture is changing. Tobacco used to be the predominant crop, but a state-sponsored buyout in 2001 encouraged growers to pursue other ventures. Since then, it has become more common to find small farms that grow vegetables, fruit or cut flowers, often with organic techniques.

First-generation and veteran farmers alike now frequently sell these crops to upscale restaurants and farmers markets in Washington and its suburbs.

"You're seeing it more often in folks who have worked off the farm, in urban settings. They see this as a way to fulfill their life's ambitions, to work outside with their hands," said Ben Beale, an agriculture educator in the St. Mary's County office of the Maryland Cooperative Extension who teaches classes for new farmers. "With farming, you're able to see the results of your work almost instantly. . . . You can get a sense of accomplishment out of that."

Dan and Sue Gragan headed for the country 10 years ago, when they were in their mid-forties. They left high-paying jobs in the District to start growing berries, peaches, cherries and other produce in St. Mary's County.

In her previous existence, "when I had [long] fingernails," Sue Gragan was a lobbyist on Capitol Hill for the commercial construction industry. Her husband did engineering design work. Both enjoyed helping friends who owned a peach orchard in Calvert County, they said, and neither was afraid of hard work.

"Next thing you know, we had 109 acres," Sue Gragan said.

She has found that farming is grueling, "the hardest I've ever worked in my life." The hours seem endless on their D&S Farm, planting and harvesting in the fields, or driving to farmers markets throughout the Washington area to sell their produce. Then there's maintaining machinery, working out farm finances, preparing jams and preserves. And yet, Gragan can rattle off all that she doesn't miss about urban life: the commute, rush hour, dealing with corporations and Congress.

"It's kind of amazing, to see that we've made this work," she said. "That we've got 1,000-plus fruit trees that are healthy, and fruit that restaurants and customers want." It has taken several years, but the farm now makes a profit, she said, though she and her husband still supplement their farm income with part-time work in the winter.

Kathy York, 49, and her husband, Sandy, have operated the Scarborough Farm cut flower business in Mechanicsville for nearly a decade. She remembers the last straw in her decision to quit her sales support job for Xerox Corp.

"The commute from Washington was taking me two hours, and by the time I got home, I would be a raving maniac," she said. "One night it took me five hours to get home. That was when I said, 'Let's try to make this farm pay for itself.' "

York grows more than 100 varieties of flowers behind her house, including lisianthus, bleeding hearts and dahlias. One recent morning, she moved through the rows of flowers, snipping stems and stripping off excess leaves. She wore paint-spattered overalls and had rubber bands around a bronzed forearm.

Farm life can be idyllic at times, she said, watching dragonflies bob through the flowers, smelling the cinnamon basil. She can hear the soothing clop of Mennonite buggies out on the road. But she also has found farm work to be no fantasy job.

"People think farming, 'so beautiful, so romantic.' But they don't see me when I'm out here sweaty and dirty, when it's raining or when the mosquitoes are angry," she said.

In addition, making a profit off the fields is a constant challenge, she said. She sells flowers to florists, does wedding arrangements and has a subscription service through which customers pick up fresh flowers weekly at her farm. Still, her husband, Sandy, continues to do brick and mortar work to help pay the bills.

Scott Hertzberg said revenue from his organic farm, the Jug Bay Market Garden, has doubled each year since he and his wife opened it. He also runs a subscription service, selling fresh vegetables. But farming doesn't generate enough money to cover the couple's year-round expenses, he said.

Hertzberg said his wife probably will have to keep her full-time job in the city. As for his future as an office-bound librarian, he said, "I've just realized by now I'm never going to make it in the professional working world."

Just after dawn on a recent Wednesday, the mist hung low in Hertzberg's sloping field, where he enjoys calculating whether the recently planted zinnias and green beans will outrace the first frost.

He had shed his wool sweater, and the sun was drying the dew off his work pants. The next day, he would be back in his Justice Department cubicle, a tie knotted to his neck. He bent to examine winter squash that had spoiled after the heavy rains and made a mental note to plant them much earlier next year. After all, it is his decision to make.

Scott and Tanya Hertzberg grow vegetables and flowers organically on nine acres in southern Prince George's County.Hertzberg has traded in an office for an old tobacco barn part time, but his wife has had to keep her full-time office job to help support them.Scott Hertzberg's commute to work some days is a walk through the fields of his farm instead of a trip to the District.