In a major decision under the District of Columbia landmark preservation law, a developer was refused permission yesterday to demolish a 111-year-old downtown building to provide a site for a new YWCA headquarters.

The building is the former Julius Lansburg Furniture Co. store on the northwest corner of Ninth and F streets, which was built in 1868 as a Masonic temple.

Carol Thompson, serving as official agent of Mayor Marion Barry under terms of the landmark law, said developer Dominic R. Antonelli Jr. failed to prove economic hardship in making his request for demolition.

The city's announcement of the decision said Antonelli's only recourse is to the courts.

The three-story building, which has been vacant for several years, is across Ninth Street from the old Patent Office, which now houses Smithsonian art galleries.

A year ago, the Young Women's Christian Association approved a complicated real estate deal with Antonelli, a millionaire developer and parking magnate. It would have resulted in erecting a YWCA headquarters on the site of the historic building and Antonelli's erecting a retail complex with offices and possibly condominium units on the north side of the site, facing G Street.

The YWCA has agreed to sell its present headquarters at 17th and K streets NW.

Spokesmen for Antonelli and the YWCA could not be reached immediately for comment.

Thompson, the mayoral agent, is special assistant to the city's director of housing and community development. She is now considering an application from Developer Oliver T. Carr Jr. to demolish the even more historic Rhodes Tavern at 15th and F Streets NW for another retail development.