The D.C. City Council, in a surprise move, approved across-the-board rent increases yesterday ranging from 2 to 10 per cent for most of the city's 180,000 rental apartments and homes.

The rent boosts, expected to be put into effect in December and January, were authorized by a 7-to-6 vote on an amendment to an emergency measure designed to extend the city's controversial rent-control system for 90 days. The razor-thin margin reflected the Council's severe split over the issue.

The Council had taken emergency action last week that appeared likely to delay any overall rent increases possibly until next spring.

Yesterday's unexpected Council shift prompted immediate protests from tenants' groups. Sheila Boykin, an organizer for the Emergency Committee to Excessive rent rises. Council man Douglas E. Moore an opponent of the rent increases threatened to sue his fellow Council members in court, terming their tactics "illegal."

Spokesmen for the city's landlords hailed the Council's action as a forward step, but complained, nevertheless, that the planned 2-to-to per cent rent boosts would tall short of rising costs.

A spokeswoman for Mayor Walter E. Washington said the mayor would not announce whether he will sign the emergency rent increases into law until he has had further time to review the legislation. The mayor, however, is believed to support an extension of rent controls in some form. Unless an emergency rent-control measure is adopted by Oct. 31, the city's rent-control system will expire.

Under the measure passed by the Council yesterday, rent increases would be limited to 2 per cent for landlords whose rental charges do no include utility costs. For landlords whose rents cover some or all utilities' costs, rent rises varying from 7 to 10 per cent would be allowed.

Landlords would be required to give their tenants 30 days'notice before institution higher rents. In adition, any landlord who has recently gained permission for a rent increase through a special administrative or court proceeding would be compelled to wait six months before raising rents again.

The Council also is considering a long-term rent-control measure that would extend the city's program of setting ceilings on rents until Sept. 30, 1980, and would permit possible increases in rents annually. Under the proposed bill, any future rent rises would be set by the D.C. Rental Accommoodations Commission, a panel that oversees the rent-control program. Such rent increases would not be permitted to exceed rises in the Labor Department's Consumer Price Index.

With more than 500,000 District residents living in rented apartments and homes, the 3-year-old local rent control program has stirred a continuing controversy in the City Council, which has been grappling with the issue for months.Council members have faced heavy lobbying by both landlords' and tenants' groups.

Yesterday's move to grant rent increases followed recommendation by the D.C. Rental Accommodations Commission. Several key Council members, including Council Chairman Sterling Tucker and at-large Councilman Marion Barry (D-at large), both of whom are viewed as possible candidates for mayor in 1978, voted for the rent increases. The increase amendment was sponsored by the Council's lone Republican member, the Rev. Jerry A. Moore Jr. (at large).

Earlier this year the Rental Accommodations Commission conducted a study of rental housing costs in the city. The study concluded that rent increases ranging from 2 to 10 per cent would be needed to compensate landlords for rises in utility and other costs during 1976. The commission which includes both landlord and tenant representatives, reaffirmed its recommendations in a unanimous vote Monday night.

Michael J. Moorhead, the commission's chairman warned in a letter to Council Chairman Tucker yesterday that further delay in authorizing rent rises would "undermine" the rent control program and would "stand as another example of administrative and legislative lethargy." Moorhead urged immediate Council action on the proposed rent increases.

Tucker cited Moorhead's letter yesterday in urging the Council to approve rent increases.The seven votes in support of Jerry Moore's amendment had already been collected on a procedural petition before the Council session began.

In addition to Jerry Moore, Tucker and Barry, the amendment to permit emergency rent increases was backed by Arrington, Dixon (D-four), William R. Spaulding (D-five), Nadine P. Winter (D-six) and Willie Hardy (D-seven). Winter, who heads the Council's housing committee, had unsuccessfully urged the Council last week to pass an emergency bill that would have permitted the same 2-to-10 per cent rent increases.

A roll-call vote was not taken last week when the Council set aside Winter's emergency bill and voted instead to extend rent controls for 90 days without any immediate rent rises. It was not altogether clear yesterday why the Council had shifted ground on the issue. Nevertheless, some Council members said one apparent factor was that Winter's proposed bill had included a number of other controversial provisions - in addition to rent increases - that some Council members found troubling.