Montgomery County officials, attempting to keep rental housing affordable for low- and middle-income residents, used a law for the first time yesterday to buy two rental apartment buildings in Chevy Chase and Bethesda for $4.3 million and prevent them from being converted into condominiums.

The county law, enacted five years ago and modeled after a state law passed the same year, gives the county the right to intervene and buy a rental apartment building when a prospective buyer plans to convert the building to condominiums or raise rents dramatically. The county must match the terms agreed to by the owner and the prospective buyer.

"This will allow low- and moderate-income people to have a chance to live in Chevy Chase and Bethesda," said Richard J. Ferrara, director of the county's Department of Housing and Community Development. "Low- and moderate-income housing is extremely scarce there."

Montgomery County has 55,000 rental units but that is not enough, according to Ferrara. "We always have thousands of people on the Housing Opportunities Commission waiting list," he said.

The two properties purchased by the county are Chevy Chase Lake Apartments, with 65 units, located at 3719 Chevy Chase Lake Dr. off of Connecticut Avenue, and Fairfax Court Apartments, with 18 units, located at 1 Fairfax Ct. near Bradley Boulevard. Rents there range from $450 to $550 a month.

The apartments will be preserved as moderate-cost rental units, allowing current residents to remain there, said Ferrara. Rents for current tenants will not increase more than 10 percent above what they are now, he said. If the buildings had been converted to condominiums, rents would have increased about 45 percent, Ferrara said.

County Executive Charles W. Gilchrist said the purchase "will avoid unnecessarily disrupting the lives of existing tenants, many of whom are elderly, and will assist hundreds of future low- and moderate-income families in the coming years."

"It's a happy day," said Lea Cassidy, 76, who lives in a one-bedroom Chevy Chase Lake apartment. "I'm not exactly starving to death, but I can't afford to buy a condo. And I'm too old to go house hunting."

The county has had the opportunity to buy rental buildings before, but most were too expensive. Chevy Chase and Fairfax Court were "available at a reasonable purchase price, considering their location, and their size made the purchase feasible" using money available in the county's condominium transfer tax fund, Ferrara said. Money for the special fund comes from a 4 percent tax added to the price of apartment buildings when they are sold and converted into condominiums.

G.V. Brenneman of Brenneman Associates Inc., a real estate firm, had signed a contract to buy Fairfax Court before the county submitted its bid, according to John Matthew Gambrill, who owns the building. Brenneman could not be reached for comment yesterday.

The name of the prospective buyer of Chevy Chase Lake could not be learned yesterday.

County officials have not decided who will operate the apartment buildings or whether the county will subsidize rents for some of the units. Ferrara said final settlement on the purchase of properties is expected by the end of October.