The District government wants to buy a rundown apartment building on Columbia Road and convert it to public housing in an attempt to end a bitter two-year struggle between the landlord and tenants there while keeping the tenants in their homes.

If the federal government approves $1.7 million to buy and renovate the five-story, 38-unit building, it would mark only the second time that the city has assumed the role of landlord in an effort to prevent the displacement of low-income tenants.

Two years ago, the city bought a 15-unit building on Ontario Road where tenants were due to be displaced because the building was in foreclosure.

But at no other time have city officials attempted to combine the policy of scattering public housing throughout the city with avoiding displacement and ending landlord-tenant disputes that have led numerous landlords to hold apartments vacant at a time when there is an apartment shortage in the city.

D.C. Housing Director Robert L. Moore agreed two weeks ago to try to obtain federal approval to buy the Imperial Apartments, an imposing dark brick building at 1763 Columbia Rd., whose marble entranceway is a reminder that the area was once one of the city's best addresses.

The building is now the the home of 16 families, some of whom work as domestics, beauticians, cafeteria workers and government clerks. About half the families are Hispanic, the rest are black.

Moore made the promise during a two-hour meeting with the tenants and owner George S. Dravillas, a well-known Columbia Road realtor and developer.

"We said we would use our best efforts but we have not made any commitments that we could [get the federal approval]," Moore said yesterday.

He noted that the proposed federal budget includes no money for new public housing projects in the coming fiscal year, and that the U.S. Department of Housing and Urban Development has a four-year-old prohibition against elevators in public housing for families. The Imperial has one elevator. Moore said HUD would be asked to waive that prohibition.

But Dravillas and the tenants must agree to settle their long-standing, bitter dispute before the city will go to HUD, Moore said. An attorney for the tenants said it was unclear when an agreement would be reached.

The agreement will probably require HUD approval by July, according to Moore and a tenant representative.

If the federal government rejects the purchase, the tenants will be evicted, said Moore and Desiree Jones, vice president of the Imperial Tenants Association. "It's going to be like a cliffhanger," she added.

Jones said although the tenants were unhappy that they could not afford to buy the building, "We wanted anything we could get so we could stay."

Dravillas could not be reached for comment yesterday, and his lawyer, Martin McMahon, said he had no comment.

For the last two years, the building, with its high ceilings and spacious apartments, has become a symbol of tenant-landlord confrontation in Adams-Morgan, where poor tenants have in recent years been driven out as their homes and apartments were renovated and sold with six-figure price tags.

Moore said yesterday that the battle between Dravillas and the Imperial tenants began in mid-l980 after the tenants thought they had an agreement with the owner to buy the building but later discovered that Dravillas, who had been the building manager, had purchased it instead.

The tenants filed suit in D.C. Superior Court alleging that Dravillas and the building's owner at the time had violated city laws that give tenants the first right to buy their apartment buildings when they are put up for sale, Moore said. At nearly the same time, he said, Dravillas sent the residents eviction notices.

Jones, of the Imperial tenants association, said that at numerous times since then, there has been no heat or hot water in the building.

In the winter of 1980, she said, the tenants used flashlights to get from the front door to their apartments when the electricity in the building failed. Tenants have been robbed at knifepoint on dark stairways, the elevator is broken and now squatters live in some of the building's 22 vacant apartments, she said.

The tenants now care for the building, Jones said, spending their own money to replace hallway lights, removing trash and cleaning hallways. Moore said the city has spent nearly $200,000 over the past two years for fuel oil and building repairs.

Last week, the Eighteenth and Columbia Road Business Association sent a letter to Moore, Mayor Marion Barry and HUD Secretary Samuel R. Pierce opposing the city's plans, saying Columbia Road was unsuitable for public housing.

The businessmen contended that "the exhaust fumes of the heavy truck and auto traffic along Columbia Road would be highly detrimental to children and parents living in the Imperial."

They suggested instead that those tenants still living in the Imperial be moved to the top two floors of the building and that the remainder of the building be used for offices and stores.