The federal government announced plans yesterday to turn an old Navy Department building in Anacostia Park into a temporary 600-bed shelter for the homeless, and said it would close a crumbling shelter downtown soon after the Anacostia facility opens in mid-October.

The shelter will be operated by the D.C. Coalition for the Homeless, a four-year-old group of more than 300 organizations and individuals that has often been at odds with the Community for Creative Non-Violence, which operates the downtown shelter at 425 Second St. NW.

Coalition officials said buses will be provided to carry street people from the Second Street area, Lafayette Park, and other places where they congregate downtown to the new shelter, which is located near the South Capitol Street Bridge.

The Coalition will receive $3.7 million from the U.S. Department of Health and Human Services to operate the temporary shelter and to establish and renovate long-term shelters elsewhere in the city, officials said.

In addition, HHS deputy undersecretary Dixon Arnett said the government would provide at least $500,000 worth of goods and services such as buses, surplus food, mattresses and medical personnel.

Under the agreement announced yesterday, the building must be emptied as a shelter by April 30. Coalition officials said they were confident that smaller, permanent shelters could be established by then and asked Mayor Barry and other city officials to meet with them soon to make plans.

"We look forward to a period of reconciliation and implementation," Elisabeth Huguenin, president of the coalition, said.

Government lawyers disclosed the plan yesterday afternoon at a hearing in the U.S. Court of Appeals where both the CCNV and HHS are challenging parts of a ruling last month by U.S. District Court Judge Charles R. Richey.

Richey said the government could close the 800-bed shelter downtown, but only after relocating shelter residents and devising a long-range plan "to eliminate homelessness in the nation's capital."

Peter J. Nickles, a CCNV lawyer, called the new plan "a charade intended by the federal defendants to let them walk away from their commitment" to renovate the Second Street shelter.

Spottswood W. Robinson III, chief judge of the Appeals Court, ordered the government to give the court copies of its agreement with the Coalition, which was signed Wednesday evening, and documents obligating the $3.7 million, which are expected to be issued late today. But he did not indicate when the court would rule on the case.

Government lawyers said the funds are part of the federal budget for the 1985 fiscal year, which ends Monday, and will lapse if they are not obligated by then.

In an interview, Arnett said that once the money is obligated to the coalition, no funds will be available for the CCNV shelter, which is also in a government-owned building.

But Nickles said the court might order the government to make major renovations at Second Street with funds provided by a continuing resolution for 1986, which has been passed by Congress and is awaiting President Reagan's signature.

Last November, President Reagan, prompted by a 51-day fast by CCNV leader Mitch Snyder, promised to turn the Second Street facility into a "model physical shelter." But after the HHS authorized $2.7 million for renovations on May 30, CCNV blocked federal workers from starting work, claiming the project was inadequate.

The CCNV pressed for a more elaborate plan, which the government said would cost $10 million, and filed suit to force the extensive renovations. The government then said it would close the shelter, but the closing has been delayed several times as the case has proceeded in court.

The coalition and Arnett have asked the District government to help in providing space for people using the Second Street shelter, but Barry has repeatedly refused to step in, saying the federal government should keep its "social contract." Last week he rejected a plan to house hundreds of homeless in trailers on District property.

Edith Marshall, an assistant U.S. Attorney, said yesterday that since the Anacostia building is on federal property, the District government did not have to approve its use as a shelter. The two-story structure at 1900 Anacostia Drive SE was built during World War II and was used most recently as offices for the 1985 inaugural committee. It has been vacant since April.

A spokesman for the District department of human services said the city government would have no comment last night.

Outside the courthouse, Snyder said, "It would be nice to have a shelter in Anacostia, but I do not think that has anything to do with the [homeless] people downtown . . . . The cost of transportation is astronomical and they'll wind up with empty buses."

In addition to $2.7 million for general shelter operations and renovations, Arnett said, $1 million of the grant to the coalition will be used for special programs for the homeless who are aged or mentally ill. He said CCNV did not qualify for these grants because it is not registered as a tax-exempt nonprofit organization.