The Department of Housing and Urban Development has approved more than $5.5 million in federal loans to two Washington area nonprofit groups to provide housing for the elderly and mentally disabled.

The Upper Room Housing Corp., an affiliate of the Upper Room Baptist Church, will get $4.97 million to construct a 96-unit building near the church at 3760 Minnesota Ave. NE. Low-income elderly residents of the building also will receive federal rental assistance.

Arlington Community Residences Inc. was given a $573,500 loan to buy and rehabilitate homes for mentally retarded and mentally ill persons, who will also get rental assistance.

Money has been reserved for the 40-year loans, at 9 1/4 percent interest, but will not actually be given to the organizations for 18 months to two years, according to a HUD spokesman. The time is required for appraisals and loan processing, he said.

The loans are being made under the 1959 National Housing Act's Section 202, one of the few direct loan programs HUD operates. In most of its other housing programs, the department insures private loans.

HUD will lend a total of $556.7 million to 384 nonprofit groups in 42 other states, Puerto Rico and the Virgin Islands, the department said last week. Most of the money -- $434.1 million -- will pay to build 9,761 units of housing for the elderly. The remaining $122.6 million will pay for 2,928 units for disabled families and individuals.

The Rev. Willie B. Allen, saying that older people too often are "left out, deserted, abandoned and abused," said providing housing for the elderly was "part of the vision I had" when the Upper Room Baptist Church was founded in 1957. Work on the new building, the church's first venture into housing, will begin "as expeditiously as possible," he said.

The church also hopes to provide medical care for residents, Allen said.

The Arlington group will use its loan to provide seven units of housing for mentally retarded persons and seven units for mentally ill people, according to the group's president, Jill Gruver. The 12-year-old organization, which already provides housing and care for about 130 people, hopes to build a house large enough for seven people and to purchase and renovate a home for another seven, she said.

"We need large houses, the kind you put a large family in," Gruver said. Mentally retarded people with which the group works live in a home with staff members, while those with mental health problems have help from workers during the day but stay alone at night.

Residents of the homes pay rent "according to their ability," she said.