Motorcyclists would joyride in the wheat plots and horseback riders giddyap through the soybeans. Hungry hikers sneaked into the peach orchard and snacked on the fruit. A few times neighbors phoned the Environmental Protection Agency, when the wind shifted over newly manured fields. Even the pigeons and crows were plagues, descending in droves on the only good place to eat for miles around.

For the researchers and graduate students at the University of Maryland's Plant Research Farm in eastern Montgomery County, the spectors of blight and drought pale before the perils of farming on the urban fringe.

So after more than 40 years of tinkering with tilling methods and gene pools on a 319-acre tract that has been all but engulfed by subdivisions, industrial parks and major highways, the research farmers are packing up their grain loaders and seed cleaners and retreating to less popular ground.

In place of the hilly pastures that make up the largest open tract of farmland left within Montgomery's expanding urban perimeter, will be an extensive office park, new roads and more than 69 acres of town houses and garden apartments built by a developer who is purchasing the land for $8.5 million.

The irony for many of the neighbors in nearby subdivision who did not particularly mind the smell of fertilizer in the spring and cherished the pageant of corn and oak trees burgeoning on a distant ridge is that wittingly or unwittingly, their enthusiasm for the farmland played a major part in the farm's demise.

"It's so sad," said one woman who bought her home for the view from her living-room picture window: a panorama of knee-high wheat, rising and rolling to oak groves and the gambrel-roofed white barns of the farm. "That field was why I bought here. To me it's serenity."

Nancy Middleton, 17, who lives across the street from the farm, remembers seeing a red fox for the first time, skulking through the corn stalks, and winter days when she went sledding with other children in the neighborhood.

"The fields give you a feeling of space," she said. "A lot of us have gotten used to it. It's always been there."

Another neighbor whose house fronts the farm is bitter. "Very, very seldom is change for the better," she said. 'You better look at the [hillside] now because it will never look the same."

The farm is the last vestige of the way the landscape off Rte. 29 and 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, or the country to the north was colonized with the Calverton development.

The university first decided to put the land up for sale in 1968. Besides the problem of keeping research peaches out of the mouths of foragers, the farm's sandy soils were not typical of farm land found generally in Maryland. And the agricultural program managers felt much ideally located acreage would fetch a lot of money that could be plowed back into the 10 other research farms the university runs around the state.

But the sale was delayed while the county government reviewed the land for use as a campus for Montgomery Community College, and it ran afoul of the county's sewer moratorium.

Finally two weeks ago a contract was approved with Chevy Chase developer Shelton Zuckerman, who will buy the tract. Some experiments may run through 1985, but next spring will be the farm's last complete planting, according to farm manager Bill Varano.

"I'm a little depressed but only because it rained for a week and I've got a lot of work to do," said Varano, who has managed the farm for the past 11 years. "It's people. Thirty years ago Rte. 29 was just a rambling cowpath. It's incredible how much it's changed. If one car runs through a breeding block, if someone takes only five or six peaches, it puts a question on the research data.The residents around here would like a park but farms aren't recreation areas. People don't belong."

Although Montgomery County has managed to retard the rate at which its 120,000 acres of farm land is developed, the demise of the research farm illustrates the headaches that many of the county's 650 commercial farmers have as they try to move farm machinery on roads clogged with impatient commuters or protect their fields from avid recreation seekers.

"Everyone who farms on the urban fringe has problems, but in Montgomery County the nuisance problem is tremendous," said Robert Rayber of the counthS Agricultural Extension Service. "It's been promoted for so many years as the bedroom of Washington. It attracts people. You spray your fields and everybody thinks they see something happening to their rosebushes."

Since the farm was put up for sale, the problems on the urban fringe have only grown worse, according to Lamar Harris, director of all the agricultural experimental farms in the state.

"We didn't used to see the road trail bikes," Harris said. "We're doing work where we're trying to control variables. If someone runs a motorbike on a turf grass plot, you don't know how to take that into account."

The university runs a similar farm in Upper Marlboro in Prince George's County, but there "they got a fence up in time," Harris said.

Even a fence wouldn't cure all the problems at the Montgomery farm.

"I suppose you could put up a big fence," sighed Varano. "But the birds are even worse. They're country birds in a city atmosphere, and they don't have much to pick on so they all hit us. We have to put an extra-wide border around the edge of the crops. They pick the edges first. You could call it cultural control." CAPTION: Picture 1, Trees frame University Maryland Plant Research Farm buildings; Picture 2, while Mary Hannon, agricultural technician, checks plots. The 319-acre tract, which has been in use for 40 years, has been sold to a developer for $8.5 million. Photos by Fred Sweets -- The Washington Post