The Metropolitan Washington YMCA and Shaw community representatives announced details yesterday of an agreement to end the legal battle over the Anthony Bowen YMCA by raising $2.6 million to restore the building as a multipurpose community center.

YMCA officials closed the building, at 1816 12th St. NW, in 1982 after concluding it was unsafe. But community residents, accusing YMCA officials of neglecting the inner-city facility, filed a lawsuit and a D.C. Superior Court judge blocked the YMCA from selling or disposing of the building.

Yesterday, YMCA officials, members of the Shaw Ad Hoc Coalition to save the building, Mayor Marion Barry, City Council members David A. Clarke and Frank Smith (D-Ward 1) and developer Jeffrey N. Cohen held a press conference to outline the details of an agreement that was worked out in principle last April.

Under that agreement, the YMCA would sell the Bowen building to Cohen for $175,000. Cohen would then lease it to the Shaw Heritage Trust Inc., a recently formed nonprofit group made up of members nominated by the Shaw Coalition and the YMCA.

Cohen has agreed to give the trust a 99-year lease on the building, with an annual rental fee of $1, and to help the trust raise $2.6 million needed to restore the building. As part of the agreement, Shaw activists would drop the lawsuit against the YMCA.

No fund-raising activities have started and no date for reopening the building has been set. The agreement, however, does say that the restoration should be completed within 18 months, if possible.

Cohen, chairman of the National Bank of Commerce, a real estate developer and owner of several Shaw properties, including the former Children's Hospital and the Lincoln Theater, said he will not profit from the agreement.

He is purchasing the building for half of its appraised value, Cohen said, and the trust will reap the economic benefits, including the right to sell part or all of the the project's tax benefits to private investors.

Cohen said he became involved in the effort to settle the dispute because the city is of primary importance to him.

"And I don't see any other developers up here trying to help out," said Cohen, who added that he hopes the effort will serve as an example of how District businessmen can go a step beyond giving contributions when city neighborhoods need financial help.

During the press conference, Barry said that the agreement represents the willingness of both sides in the dispute "to put aside their differences and . . . come to a position of positive strength."

Although the lawsuit against the YMCA would be dropped, Steve Newman, a member of the YMCA's board of directors, said that the community never needed to file a lawsuit to get the YMCA's participation. He said that the agreement is similar to a proposal that the YMCA made in 1982.

"There is the impression that there is a victory for the people who sued," said Newman. "There is a victory for the community and the YMCA is part of the community."

The YMCA will operate some programs in the Bowen building after the renovation is completed.

The four-story Bowen building was named for a former slave who founded the first black YMCA chapter in the nation. The building served the black community as a segregated YMCA from 1912 until 1960 and had been a center of cultural and political activities in the city since the 1920s. The building is listed on the National Register of Historic Places.