Mayor Marion Barry, ever the imaginative host, staged a gala luncheon for 150 yesterday in a tent pitched on the former site of a 183,000-ton pile of sewage sludge.

The event, held at the Blue Plains wastewater treatment plant in the far southern corner of Washington, was to celebrate a five-year regional pact for disposing of the mountains of sludge produced by the facility.

"Last January, the site of this celebration was covered with a mountain of sludge," Barry said. "Clearing this site is symbolic of what we have achieved here to resolve our longstanding waste-disposal problems."

While the sludge pile indeed was gone, an ammonia-like odor wafting under the yellow-striped tent did little for the appetites of the guests, who were served chicken, fish, salad, rolls and cake.

"You get used to it," said John Touchstone, the city's director of public works and master of ceremonies for the event.

The guests' discomfort was prolonged by the mayor, who arrived 45 minutes late. John F. Herrity, chairman of the Fairfax County Board of Supervisors, stood impatiently by an entrance to the tent as the mayor walked in.

"I thought you were going to boycott your own program," Herrity said.

The event marked the end of the city's long, tortuous and frequently bungled efforts to dispose of sludge at the District-operated Blue Plains plant, a regional facility that serves the surrounding metropolitan area.

Under the terms of a federal court order, each jurisdiction is responsible for disposing of its share of the sludge produced at Blue Plains, which totals about 1,270 wet tons daily. The District, with virtually no place within its boundaries to dump its share, has for years retained a series of hapless contractors who frequently had problems in processing and disposing of the sludge.

The situation reached crisis proportions last fall after Jones & Artis Construction Co./National Environmental Control Inc., a joint venture retained by the city without competitive bidding, lost its dumping permit and the sludge began to pile up.

In the wake of reports that the contractor had secretly dumped chemically treated sludge within the city limits, Barry declared a moratorium on his top aides discussing the subject until he was able to enlist support from neighboring jurisdictions to deal with the latest crisis.

Last January, Fairfax, Montgomery and Prince George's counties each agreed to accept roughly a third of the stockpiled city sludge, while the District assumed responsibility for disposing of about 12,000 tons of unscreened compost.

Yesterday, Barry formally announced that he and officials of the three counties and the Washington Suburban Sanitary Commission (WSSC) had signed a five-year regional contract, worth a total of $74.5 million, to cover the disposal of all the sludge produced at the plant.

"It is truly ironic that such a grossly unpopular issue as sludge disposal should be a driving force for regional cooperation," D.C. City Council member Jerry A. Moore Jr. (R-At large), chairman of the Transportation and Environmental Affairs Committee, said during the ceremony.

Under the agreement, a joint venture of Ad+Soil, Inc., Enviro-Gro and MTI Construction will get $33.60 a ton for hauling 200 tons a day of "digested" processed sludge -- a total of $2.45 million a year.

A second joint venture of Jones & Artis and BioGro/Bevard will receive $34.80 a ton for hauling 500 tons a day of processed sludge and $29.18 a ton for hauling 570 tons of unprocessed sludge daily. The two rates total $12.4 million a year.

A separate piece of the contract for 360 tons a day of compost was deferred because of technical problems, according to city officials.

Officials project that the city will save about $7.9 million over the five years of the contract by banding together with the other jurisdictions.

The jurisdictions also have signed a memorandum of understanding to consider future expansion and improvements at Blue Plains. The federal Environmental Protection Agency (EPA) requires such an agreement as a prerequisite to providing grant funds for future construction.

District officials say the long-term solution to their problem is to build a furnace at Blue Plains to burn most of the city's sludge and to dispose of the remainder through composting. The city is seeking federal approval and funding for its so-called "codisposal" plan.