Homeless men and women, volunteers and staffers hold hands during a prayer before the opening of the new Lamb Center in the city of Fairfax. (Astrid Riecken/For The Washington Post)

A sign of the changing attitudes toward homelessness in Washington’s suburbs lies inside a just-built, $4.5 million center in Fairfax City that, four years ago, might have been reviled instead of embraced by leaders in the Northern Virginia community.

The new Lamb Center, which will celebrate a grand opening Sunday, offers private showers, health care, laundry service and a large pantry stocked with donated pastas, cereal boxes and canned goods. A dental suite will open soon.

Most of all, since beginning operations recently, it gives roughly 100 homeless people per day a sense of belonging in an affluent suburb where elected officials once fought to push out the 23-year-old nonprofit organization.

“Our relationship with the city now is like night and day,” John MacPherson, the center’s executive director, said while standing recently inside the center’s packed lunchroom.

The Fairfax City Council, which earlier this year unanimously approved the rezoning application to convert a former auto upholstery facility into the center for the homeless, “has been nothing but supportive,” MacPherson said.

That wasn’t the case before Fairfax City lost a battle at Virginia’s Supreme Court against the Lamb Center in 2012.

Founded by a coalition of churches as a small counseling service, the Lamb Center had expanded by 2008 as homelessness spread in Northern Virginia. The number of people served each day doubled from an average of about 55 to more than 100. Before long, the center was offering meals and hot showers inside its cramped home, on the edge of a strip mall where Lee Highway and Fairfax Boulevard meet.

Local business owners and residents complained about people loitering.

Under then-Mayor Robert F. Lederer, city leaders fined the Lamb Center for zoning-code violations, triggering a legal dispute. City officials also moved to find a new home for the organization outside the city, going as far as an offer to purchase the land, which residents in nearby Fairfax County opposed.

In 2011, the city passed a zoning ordinance that prohibits organizations serving the homeless from being within 1,000 feet of a grocery store or other retail outlet that sells alcohol.

The following year, the state Supreme Court ruled that the Lamb Center had the right to offer meals and showers. By then, Lederer had been succeeded in office by R. Scott Silverthorne. The new mayor, who won a third term last month, brokered an agreement to move the Lamb Center to a new building less than a quarter-mile away from its old home.

A last prayer inside the old Lamb Center before the move into a new, much larger building. (Astrid Riecken/For The Washington Post)

“I didn’t believe that confrontation or disagreement with the Lamb Center was getting the city anywhere, and the Supreme Court ruling confirmed my feelings,” Silverthorne said. “I approached them and said, ‘Let’s put our collective heads together and find a better location.’ ”

Fairfax leaders now describe the center as a necessary part of the future for the city of 24,000 residents. Arlington County last year opened a similar facility that also includes shelter beds.

“There are homeless persons in the city of Fairfax and the surrounding area, and that’s a fact of life,” said City Council member David L. Meyer, who for years was the Lamb Center’s sole supporter on the council. “But the constituency of the center is not just the city of Fairfax. It is truly regional.”

On any given day, there are about 1,060 homeless people in the area that includes Fairfax County and Fairfax City, according to the county’s most recent annual census. That number is down from about 1,835 in 2008, said Dean Klein, who heads Fairfax County’s Office to Prevent and End Homelessness.

Increasingly, homeless people in the area are over 50 and work low-wage jobs, Klein said. Many have camped out in wooded areas for years and in some cases have lost their campsites as new subdivisions or commercial strips are built. Among younger homeless men, the number of veterans of the wars in Afghanistan and Iraq remains a problem, despite a nationwide effort launched in 2010 to find them housing for veterans.

Klein said there is still “some negativity or resentment” against homeless adults in the area, including in Bailey’s Crossroads, where residents are fighting an effort to relocate a walk-in shelter to make room for a new mixed-use development planned at the shelter’s current Moncure Avenue site.

But the county has shown its support by allocating $500,000 toward building the Lamb Center. Church groups and private individuals have raised $3.5 million, with $500,000 still to go.

The 10,000-square-foot, two-story building is about three times as large as the center’s former home — space enough to house four counselors and a caseworker with the U.S. Department of Veterans Affairs who works there four days a week.

Terry Downs, a Fairfax City resident who led the drive to raise funds for the new building, said members of local churches often go there to help serve lunch and greet people as they walk in from off the streets.

“There’s a real sense of community,” Downs said. “I think there is a ‘not in my back yard’ attitude with homelessness and anything else that people find scary. Once you get involved in something like this, those phobias leave us all.”

Volunteers serve a meal to guests during lunch at the new Lamb Center building. The food is mostly made outside the facility since the center doesn’t have permission to prepare its own meals. (Astrid Riecken/For The Washington Post)

Inside the building one recent morning, about 40 men and women stored their valuables inside private lockers and waited for lunch to be served. Some took showers, while others dropped off their dirty clothes in the laundry room, where center volunteers operate three washers and four dryers.

John Baird Jr. said one of the new building’s most important functions is providing more privacy to people who are homeless but may not want to advertise it. The center’s previous site sat on the edge of a busy traffic circle off Lee Highway, which meant walking past retail stores and restaurants to find aid. The new building has a spacious parking lot and sits at the end of a cul-de-sac near an auto repair shop and some small warehouses.

“This one is kind of tucked back,” said Baird, 47, a former mechanic who now works as a lot attendant for an auto dealership and sleeps in his car. “It seems to be in a safer location.”

Baird said that when he first walked into the Lamb Center a few years ago, he was taken aback by the sight of parents with children, people who had jobs, and others with apparent mental illnesses.

“I had no idea there were many that many homeless people in Fairfax County,” he said. “I sat down and thought, ‘Oh, my God.’ It’s eye-opening, but it’s hurtful, too.”

Correction: An earlier version of this article incorrectly said Fairfax City Mayor R. Scott Silverthorne recently won a second term. He was elected to a third term last month.