David A. Berns has tried to retire four times in his long career as a social-services administrator. This time, he says, he means it.

Berns, 67, announced Thursday he is stepping down as director of the D.C. Department of Human Services at the end of June, leaving a post that put him in charge of responding to the city’s recent homelessness crisis.

In an interview Friday, Berns said his departure had nothing to do with the months of controversy or the Democratic primary loss last month of his boss, Mayor Vincent C. Gray. Rather, he said, he has been planning since early this year to reunite with his wife, children and 94-year-old mother in northwest Michigan. “The timing is such now that I want to get back home,” he said.

Berns, a former Arizona cabinet official and nonprofit executive, oversaw an effort to tightly integrate the city’s welfare, nutrition, housing and other social services programs, winning accolades for the work. He also won praise for his candor with the media and with advocates for low-income residents and the homeless.

But he was Gray’s deputy most visibly in charge of homeless services as a number of families seeking shelter this past winter more than doubled, and the city faced withering criticism over its handling of the influx.

Berns becomes the third official to leave the mayoral cabinet since Gray’s April 1 primary loss, joining transportation director Terry Bellamy and Nicholas Majett of the Department of Consumer and Regulatory Affairs.

In a statement thanking Berns for his service, Gray acknowledged those controversies. “David has faced major challenges in his time as DHS director, and he has responded each time with thoughtfulness, expertise, compassion and the ability to execute a plan,” the mayor said, adding that Berns “vastly improved” city programs for the needy.

Berns said Friday he was proud of his efforts to revamp the city’s welfare system, taking steps for the first time in decades to individually assess and address the needs of the more than 17,000 D.C. families receiving public benefits.

“We were 16 years behind the rest of the nation,” he said, noting that the city only in recent years moved to implement the type of welfare reform rolled out on the federal level in the mid-1990s.

Still, Berns most often commanded public attention as the city’s efforts to house homeless families struggled to meet the demand.

The city would have been better positioned to handle the spike, he said, had the D.C. Council last year accepted budget recommendations that could have made it easier to clear shelter beds. But the city’s main homeless family shelter, at the former D.C. General Hospital, remained crowded even before cold weather triggered a city law requiring the District to house those who turn to the city for shelter, forcing the District to rent hundreds of motel rooms for homeless families.

More than 350 remained in such temporary quarters as of late last month, at a staggering cost to the District.

“The biggest problem is that we have continued to fund unlimited shelter at $150 or more a night,” he said. “We have struggled to reinvest that huge amount of money and find a way to use those precious resources and invest them in better housing options.”

News of Berns’s departure comes a third of the way through a 100-day sprint that Gray announced during his reelection campaign to move 500 families out of D.C. General and motel rooms and into more permanent living arrangements by early July.

That effort continues, Berns said, but he said it has been difficult to convince landlords to rent apartments to shelter residents who don’t have jobs.

“We’re still begging and pleading for landlords to come to the assistance of these families,” he said. “If we can get them leased up for a year, we’ll continue to work with them. It doesn’t take me to be here. I’ll be cheering from the sidelines.”