Jacksonville owes the federal government $160,000 for breaking rules about demolishing old houses — and could owe another $545,000 if it doesn’t fix problems involving building repairs, a federal report says.

The U.S. Department of Housing and Urban Development outlined those problems last month, after a HUD team spent a week checking how well the city lives up to requirements set for using federal grants.

The answer, says the report, is not great.

“Basically every file reviewed had compliance issues,” said the report from HUD’s Jacksonville field office, adding: “it is clear that the city of Jacksonville currently lacks the capacity to ensure compliance.”

That’s changing, said the city’s community development chief, who used to be HUD’s Jacksonville director.

“We were very aggressive in terms of trying to improve,” said Elaine Spencer, who has worked for the city since 2012. Spencer said five of her staff were recently certified in a series of HUD rules and requirements, and can help make sure the city stays within federal guidelines now.

Preservation advocates questioned the HUD demolition rules last year after learning federal money was used to pay contractors to tear down two houses in Springfield’s historic district without the city completing reviews that HUD rules require to be sure demolition is appropriate. The city said in October that it was returning $30,000 to HUD over those two houses, but wasn’t sure what other cases might be turned up by a review.

Spencer said the city “pretty much shut down” use of federal funds in demolition until it could be sure the rules were being met.

The HUD review included records dating back to 2009, during former Mayor John Peyton’s administration, said a city spokesman, David DeCamp.

But problems that piled up before now have left a bad taste with City Council members.

“I’m really appalled to know this,” Councilman Johnny Gaffney said when a reporter asked him about the money the city would have to repay.

“I understand the Mayor’s Office has been going through a transitional period. … Some of this did not happen under their leadership. However, some of it did. And we’ve got to have some type of corrective measures to make sure it won’t happen again.”

The city can’t afford to lose money because it’s not on top of its game, said Councilwoman Lori Boyer.

“It’s just so unacceptable that we have one instance after another where we are failing to perform,” she said, a day after council members fumed over extra costs the city faced to manage the loss of water taxi service.

“We should be expecting better as an administration. There’s just no excuse,” Boyer said.

The final cost of the HUD findings isn’t clear yet.

Spencer said she’s meeting Thursday with HUD officials and will talk through issues including how the city can balance its ledgers. There might be a way the city could offset the cost against money that will be allotted in the future, Spencer said, but that’s not certain.

Also unclear is whether the $545,000 cost the city risks over violations involving building renovations will stand firm. HUD gave the city until late August to work out the renovation problems, while the agency said there was no way to make up for damage done by demolitions.

The HUD report said its staff found 13 cases, each involving demolition of a building at least 50 years old, where federal rules were broken.

One of the preservationists who first raised the subject, Gloria DeVall, said Wednesday that activists had tried to raise the issue discreetly, but city officials had been dismissive. DeVall said she hoped the findings would drive home to people that federal protections apply to older buildings throughout the city, not just in historic districts.