FALL RIVER — City officials were confident their ongoing efforts to help the local homeless population were going well.

They just didn’t know how well.

“I was surprised. I thought we had done pretty good, but I had no idea that it was that good when compared to others,” said Mary Camara, Fall River’s coordinators of homeless programs.

Since 2014, the U.S. Department of Housing and Urban Development has been grading cities on how well they’re addressing homelessness. Goals built around reducing the number of days someone is homeless and recidivism rates while increasing successful exits from programs or attainment of permanent housing all factor into the grade. Cities are then ranked alongside communities of similar size.

Out of all the small cities graded by HUD in its most recent report, Fall River was ranked 12th in the nation.

“It’s amazing to me and it didn’t just happen automatically,” said Michael Dion, executive director of Fall River’s Community Development Agency.

According to Dion, the city has made a conscious effort in the last four years to organize and expand its resources intended for finding homes for the homeless.

Following a federal mandate to ease access to homelessness programs, the city developed a coordinated entry system. Dion said this restructured Fall River’s whole support network so that everyone requiring assistance would be applying at the same place.

“Before, they’d go to one place and be told to go to another. They’d get to that place and be told to go to a different one because they didn’t meet that criteria,” he said. “They were shuffled around.”

Working in collaboration between city entities and nonprofit organizations running shelters, Fall River was also able to implement a new database to track how the size of the city’s homeless population was changing, as well as the services or programs homeless residents had sought out in the past. For the first time ever, the city was also able to track the exact number of spots in local shelters were open and which ones were occupied.

People seeking services are now also assessed on a vulnerability index, which Dion said has helped place people with the most immediate needs into programs faster.

As a result, the city has seen a drop in the annual census numbers it takes for the local homeless population.

Seven years ago, Camara said the number of unsheltered people willing to be counted was close to 80. She estimates this year’s total will be closer to six, however she also noted that both of these are only the people willing to be counted. On average, she said there is usually a much larger number of people avoiding the city employees trying to county every one.

“They hide well,” said Camara. “My guess would be there are more like 60 (unsheltered homeless people) right now.”

Of the communities that fell in the “small cities” category of HUD’s report, Fall River was the highest ranked Massachusetts city. It was 30 spots ahead of New Bedford and over 100 spots ahead of Lynn.

Because of the city’s success, Dion said Fall River has seen more homeless people come looking for help in recent years, oftentimes from outside Fall River. He referred to a new shelter with dozens of new beds built two years ago as one example.

“Last year, the 50 beds there were taken and we were putting cots everywhere. Even with the additional increase in beds, we’ve had to open up the churches for overflow,” he said.

The city has also seen shifting demographics within its homeless population. According to Dion, the number of elderly people and young people between the ages of 18 and 24 who are homeless are on the rise.

Fall River received a score of “high” on each of HUD’s grading categories with the exception of successful exits from programs. In this area, the city was given a grade of “medium.” Dion explained that a large part of this grade has to do with the lack of housing for people to move into when leaving shelters.

“The rents have increased. There’s not a lot of additional low income housing being built. The city of Fall River has a lot of low income housing, but it would be nice if some of the surrounding areas would pick up and do their fair share,” he said.

Finding better ways to move people into permanent housing will be a focus of Community Development Agency in the future, Dion said. Depending on how successful the city’s efforts are, Dion and Camara said they hope Fall River will maintain its high national ranking.

“I think what you see here is what we will continue to achieve,” said Dion. “I think we will continue to be successful and hold our own.”