A five-year, $20-million contract under which sludge produced by the District of Columbia would be shipped to King George County, Va., was reported last night to be awaiting the signature of Mayor Marion Barry.

The District, which is now disposing of its sludge in Montgomery and Fairfax counties, is under court order to begin composting sludge within city borders.

Jean Levesque, the city's water resources management administrator, said the contract involving King George appears to comply with the terms of the order.

"As far as I know, there shouldn't be any problem," he said. The contract is "not against" the order, issued by U.S. District Judge John Lewis Smith.

On the other hand, Levesque said the contract with Dano Resource Recovery Inc., an Alexandria-based firm, is "not a permanent solution" to the long-term sludge disposal problem in the metropolitan area.

What to do with sludge -- the residue left by the processing of sewage -- has been one of the most difficult regional problems in the Washington area for years, and one that Judge Smith has said might reach "emergency" proportions.

At present, according to Levesque, Blue Plains is producing about 1,100 tons of sludge a day, of which the District's own sewage accounts for about 550 tons. The remainder comes from suburban sewage processed at the Blue Plains plant.

All of the sludge is now being disposed of in the Maryland and Virginia suburbs, Levesque said. The city has said it has no place within its own borders for sludge disposal.

Under the proposed contract, 800 tons of sludge a day -- about 250 tons more than the District now produces from its own sewage -- would be shipped to King George.

But when advanced sewage treatment facilities begin operation at Blue Plains late next year, Levesque said, the same amount of sewage will yield more sludge -- 2,300 tons a day, of which the city's share will be about 1,300 tons.

Officials are "still trying to figure out" what to do then, Levesque said.

Under the proposed contract, the 800 tons of sludge would be shipped by sealed barge about 45 miles down the river to a plant in King George County where it would be converted into compost, according to Henry Valentino, executive vice president of Dano Resource Recovery.

He said the company has an option on a 40-acre site and would close on it as soon as a contract was signed. Building the processing plant would take about eight months, he said.

The company had previously proposed locating a composting plant for Washington sewage in Prince William County, but the county planning commission opposed it.

Opponents of the plant in the county had expressed doubt about the possibility of marketing the compost, which is used to condition and fertilize soil.

In an interview last night, Valentino said, "We already have contracts for the total output of the plant."

He said the total operation would be carried out in a closed environment, creating no problems of pollution or odor.

Judge Smith's order requires the city to build its own composting plant on a Blue Plains site previously designated for another form of waste water treatment.

City officials had objected that the plant might cause health and pollution problems. They said last night that it would be ready on time but that they hoped it could be closed if the Dano contract is successful.