For more than 40 years, the perils of farming on the urban fringe have hindered research workers and graduate students at the University of Maryland's Plant Research Farm in Beltsville.

Motorcyclists would joyride in the wheat plots and horseback riders would trot through the soybeans. Hungry hikers sneaked into the peach orchard and snacked on the fruit.

But come December -- after years of tinkering with tilling methods and gene pools on a 300-acre tract that has been all but engulfed by subdivisions, industrial parks and major highways -- the researchers will pack up their grain loaders and seed cleaners and retreat to more secluded ground.

In place of the gambrel-roofed white barns and the hilly pastures of the farm off Cherry Hill Road, one of the largest open tracts of farmland left in eastern Montgomery County, will be an extensive office park, new roads, and more than 69 acres of town houses and garden apartments.

The 50-year-old farm was sold for nearly $11 million in 1980 to Chevy Chase developer Shelton Zuckerman, after university professors found they couldn't maintain controlled research conditions amid the suburban sprawl. Most of the dozen researchers at the farm will be moved to the University of Maryland's Western Maryland Research and Education Center in Washington County.

"It's sad, but you can't condemn the guys for selling it. From a research standpoint, it's worn out," said Herman Todd, 77, who managed the farm for 36 years before retiring in 1977. He still visits a couple of days a week to help haul bushels of fruit or to just chew the fat with some of the workers.

"Everything's worn out," Todd continued. "The vandalism steps in and, as far as research is concerned, you can't have one peach taken off a tree. We're trying to control variables. You can't lose any of that stuff."

Along with the problem of keeping research peaches out of the mouths of foragers and protecting the fields from bikers, the farm's sandy soils were not typical of farmland found generally in Maryland, workers said.

The farm is the last vestige of the way the landscape off Rte. 29 and East Randolph Road used to look before the Capital Beltway and Montgomery Industrial Park were built to the south, I-95 sliced through on the east and the country to the north was colonized with the Calverton development.

About 30 years ago, farm workers set up a retail stand and began selling peaches, apples, watermelons, blackberries, strawberries and other fruits of their research to area residents, rather than just throwing the produce away. Since then, an average of 200 customers a day have driven up the pitted, gravel-strewn driveway to buy fruit at the farm, where the picking season lasts from mid-June to mid-November.

The memories are many, workers say, mostly of hard labor -- planting the first apple tree, picking corn from the hundreds of rows of stalks, or weeding a tomato patch.

"You pick up an awful lot just working on the trees," said Tim Harbage, 27, a graduate student studying horticulture at the University of Maryland. "I never took a fruit course in my life before working on the farm , and yet I felt a lot more familiar with a lot of the things than say somebody who has that course work, but lacks the experience."

But the problems on the urban fringe have grown steadily worse, workers said. What was once more than 500 acres of sprawling farmland has been whittled to less than 300. Already some of the land has been dotted with houses, and the new four-lane Cherry Hill Highway, which cuts through an old corn field, is scheduled to open next month.

Linda Dallas, who has managed the farm since Todd retired seven years ago, said she will be reassigned to a greenhouse on the College Park campus next year.

"It's all so sad," Dallas said of the farm's demise. "I've been crying for two months; I can't stand to see any of this."

Customers, many of them of long standing, also expressed sorrow.

"I think it's terrible they're going to close," said Charlie Queen of Silver Spring, who has bought peaches and apples at the farm for more than six years. "Their prices are lower than those in grocery stores, and the fruit is better, too."