The owner of a large rental apartment building in the District does not have to give his tenants first crack at buying his building if he wants to sell, a D.C. Superior Court judge has ruled.

The ruling last week by Judge James A. Belson throws out an interpretation of city law that tenants associations felt gave them an important edge in their fight to keep their apartments as more and more buildings are being sold to developers who then convert them into condominiums.

The administrator of the city's Rental Accommodations Office and the president of the tenant group that filed the suit said Belson's ruling will strike a heavy blow to tenant rights. Representatives of landlord groups, however, said the impact on renters and landlords would be minimal.

The ruling came after the tenant group at an apartment building at 2800 Wisconsin Avenue sought an injunction against their landlord, Herbert M. Gelfand, contending he had ignored city law by not giving them first crack at buying the 107-unit building.

In rejecting that plaintiff's suit, Belson said that the city law "does not confer upon an organization of tenants a right of first refusal."

Belson said that the tenants would "suffer substantial and irreparable harm" if they were unable to buy the building and that "public policy favors protection of tenants' rights to purchase housing accommodations."

But in this particular case, he said, it appears that "those rights were fully exercised," but that the tenants "failed to reach mutually agreeable terms" with Gelfand.

D.C. City Council Chairman Arrington Dixon said that the council "intended persons to have the right of first refusal no matter what their circumstances" when it enacted the 1977 rent control law, which covers the rights of tenants to buy their buildings.

He said several council members had expressed concern "that the right of first refusal was stricken by the court." The council, he said, is considering new legislation to clarify the law.

The council has imposted a moratorium on condominium conversions and expressed concern that such conversions displace poor and elderly tenants who cannot afford to buy their apartments and who cannot find other housing because rental units are in short supply.

The ruling "takes us back to another century," said Dorothy Kennison, administrator of the city's Rental Accommodations Office, which resolves landlord-tenant disputes.

"The tenants are losing the right to even own their building," she said. "The building can literally be sold out from under you."

"If the order stays in effect, then it's a devastating blow to every tenants organization in large buildings," said Neal Sacharow, president of the tenants group that filed the suit.

But John T. O'Neill, executive director of the Apartment and Office Building Association, said the ruling would not have much effect. "I don't see any change at all."

"I'm really not clear what the impact will be," said Kenneth Ingram, Gelfand's attorney. "I don't see it as making it easier or more difficult for landlords" to sell their buildings.

D.C. Corporation Counsel Judith Rogers, the city's chief lawyer, could not be reached for comment.