The Montgomery County Council yesterday voted to buy a plush $1.1 million riding stable to save the open space in the heart of horse country from developers.

Brushing aside charges of elitism, the wealthy county's council also agreed to build 48 units of moderate-income housing on a portion of the Potomac Horse Center.

In a area where residents take land use, horses and their image seriously, the compromise gave a little something to everyone.

The vote overrode the veto of County Executive Charles Gilchrist, who as recently as Monday night said the purchase "would reflect a serious distortion of priorities." Yesterday afternoon, he said he was "pleasantly surprised" by the provision for the housing.

The Gaithersburg stable is operated by its owner, Frederick Harting, and offers lessons and has the capacity to board 200 horses and 75 young student riders. It regularly hosts local, regional and national equestrian shows and is considered the best facility of its kind in the state. It has operated at a loss for the last several years.

"For the past 20 years, I've been operating this more as a hobby," said Harting, explaining the center's financial problems. "Now that I've retired from business, I can devote my full attention to it.

"I built this as a dream (in 1961) and I want it to stay there," he added. "But how green is a dollar? Some day someone will offer me $50,000 an acre to develop it and I'm afraid I might take it."

It was to forestall this possibility and preserve the open space that the country planning board proposed to purchase the facility and then lease it back to Harding for the next 10 years. Under the terms of the proposed agreement, Harding would pay the county $32,000 annual rent and a percentage of the gross revenues.

The County Council approved the purchase in a 4-to-3 vote last month, but several days later Gilchrist vetoed the purchase and the move was supported by spending-conscious constituents.

Montgomery County is getting the reputation as a fiscal gadfly," Michael Gildea, a vice president of the Maryland State and D.C. AFL-CIO told a hearing on the issue Monday night. "How will this expense look to Annapolis when Montgomery County wants more of its share of state money?"

"The government is in the business of providing needed services," another speaker told the meeting. "Horseback riding is not a needed service."

Most of the other 150 or so persons at the hearing were in favor of buying the stable, but when the council met yesterday it did not appear that supporters of the purchase had enough votes to override Gilchrist's veto.

Elizabeth Scull, a council member, who previously had voted for the purchase, said she was unable to vote for the acquistion unless 48 housing units could be built on the farm.

Supporters of the purchase, realizing that without Scull they could not override the executive's veto, quickly called a 10-minute recess. During that time members of the county planning board obtained a verbal agreement from Harting that he would still sell the farm if housing was planned for part of it.

After the recess, council president Scott Fosler questioned whether the housing would be possible.

Dr. Royce Hanson, chairman of the county planning board, responded: "We'll be the owners of the land, and I think we can work out any siting or design problems that might come up."

In supporting the combined housing and recreation site, council member Neal Potter said, "If we acquired the property merely for riding we were worried about a deficit. This farm is an asset for many fine uses, and now, recreation is only one aspect."