The D.C. Court of Appeals, in an 11th-hour ruling upheld the city's bitterly contested rent control system yesterday dealing a severe setback to landlords who have fought it for three years.

The court's 2-to-1 decision was issued one day before the D.C. City Council is scheduled today to take a final vote on legislation designed to extend rent control for three more years. The court's ruling was immediately denounced by landlord spokesmen and praised by tenant groups.

The appeals decision was released hurriedly in mimeographed, rather than printed form. Chief Judge Theodore R. Newman Jr. said the appeals court had sought to make public its ruling in time for the Council vote, "if the Council was going to have the benefit of our views, we had to get it to them." Newman said in an interview.

The city's rent control system was upheld by Judge John W. Kern III and J. Walter Yeagley.Judge Stanley S. Harris plans to file a dissenting opinion later. Newman, who oversees the appeals court, did not take part in the rent control ruling.

In upholding the District's rent control program, the court rejected a series of arguments by the Apartment and Office Building Association of Metropolitan Washington (AOBA), the largest local landlords' group. AOBA had contenied that the rent control system was unconstitutional and "confiscatory" because the group asserted, the program deprived landlord of their right to earn a reasonable return on their properties.

The court's ruling added a major new weapon to the city's rent control battle. Shella Boykin, an organizer for the tenant-backed Emergency Committee to Save Rent Control, said she hoped the decision would strengthen the tenants' position in today's City Council debate. John T. O'Neill, AOBA's executive vice president, expressed fears that the Council might shift to more antilandlord views because of the court ruling.

It was unclear yesterday whether the court decision would alter the Council's vote. The Council is expected to take final action today on a measure that would extend rent controls until Sept. 30, 1980, and permit annual increases for most of the city's 180,000 rented apartments and homes.

The increases next year would range from 2 to 10 per cent for most landlords, under the tentatively approved Council bill. Some landlords would likely obtain authorization to raise rents more sharply, however, by filing what are known as "hardship" petitions for rent increases. In 1979 and 1980, additional rent raises for most landlords would be pegged partly to rises in the Labor Department's Consumer Price Index.

Landlords have attacked the Council's proposed legislation, arguing in part that it would prevent them from increasing rents until next spring or summer to help offset expenses which they incurred during 1976.

Mayor Walter E. Washington, who vetoed an earlier rent control measure, has not announced whether he would sign the Council's tentatively approved bill. Rent control has become a significant political issue in the District of Columbia, with more than 400,000 city residents estimated to live in rented housing.

In its nine-page ruling yesterday, the Court of Appeals set aside each of the landlords' key arguments.

The court rejected the landlords' claim that rent control amounts to an unconsitutional use of the city's "police power" and an improper attempt to "subidize" tenants at landlords' expense. The court asserted that rent control, instead, is a valid means of dealing with a severe housing shortage here, which the City Council found to exist.

The court disputed the landlords' contention that the city's rent control law denied them an adequate rate of return on their buildings and was, therefore, "confiscatory." Instead, the court said, the law permits landlords an 8 per cent of return - an amount the court described as not unreasonable - and also allows property owners a number of mechanisms through which they may pass on their increased costs to their tenants.

Finally, the court disputed the landlords' claim that the way in which the city has administered the rent control law is "inherently unworkable." The court held that, on the contrary, the city has made "serious efforts" to overcome shortcomings in the way the law was administered in its early days.

Eric A. Von Salzen, a lawyer who represented the landlords in their court appeal, declined to comment on yesterday's ruling, saying he had not had enough time to study it. AOBA excutive vice president O'Neill said, nevertheless, that the landlords would consider either seeking a rehearing of their appeal by the Court of Appeals or asking the U.S. Supreme Court to review the appeals court's decision.

"I don't think the apartment industry is going to stop fighting rent control," O'Neill added. He charged that the court has skirted key issues and ignored some of the landlords' principal arguments. O'Neill also complained that the court had taken more than a year to reach its decision and had then issued it only one day before a final Council vote. "They act like they don't know what's going on in the District Building," O'Neill said.

City officials, who had defended the rent control law court, said they were pleased by the court's decision. Assistant Corporation Counsel Michael Cain noted, however, that the ruling would not prevent future court challenges to new rent control measures.