The city is preparing to release $4 million in federal anti-poverty funds to local nonprofit organizations, ending eight months of delay.

“This is an extraordinarily long period of time,” said Diane Bennett, executive director of Benedict House, which serves people with AIDS and relies on the grant for 20 percent of its budget.

The U.S. Department of Housing and Urban Development informed the city in June that it would not release block grant funding until the city changed the way it handled the money. Late Wednesday, Mayor Byron W. Brown said the $30 million had arrived.

The changes that HUD demanded have transformed the way the block grants flow through City Hall.

Greater oversight responsibility is now in the hands of the city comptroller and Common Council, functions that had been performed by the Buffalo Urban Renewal Agency, which is controlled by mayoral appointments.

HUD has called for similar changes in cities that employed urban renewal agencies, such as Buffalo. However, over the last three mayoral administrations, the city has been criticized for mishandling the funds, and in August a HUD spokesman said that other cities using urban renewal agencies “have not had the same problems with the way they administer their programs to the extent that the city of Buffalo has.”

As the comptroller and the Brown administration have changed their operations to comply with HUD regulations, about 50 nonprofit organizations that serve vulnerable populations such as children, senior citizens and homeless people, have waited for the grants, which they typically receive in spring.

Benedict House has 34 beds that turn over throughout the year and a $1 million annual budget. The organization also had a perfect credit history but was paying shut-off notices when the money arrived Wednesday, Bennett said.

“We are thrilled that it’s resolved,” she said.

The city will first pay four organizations that notified the city they were severely impacted by the block grant delay, and all of the agencies that have submitted proper paperwork to the city should have the grants in the next three weeks, Brown said.

After sending the public service agencies their grants, the city will spend the remaining $26 million on street and sidewalk repair, demolitions, repairs to public facilities and economic development initiatives.

The mayor and others also will try to persuade HUD to allow the city to use more of the money to pay to board up problem properties. The city had to lay off the clean and seal team, which has seven or eight members whose salaries were paid with grant funds, and rehire them on the city side at a lower pay rate.

The team would respond to neighborhood complaints when squatters or thieves took over an abandoned house. Now the city will pay for the team’s $1 million annual budget.

“The city will continue to do that, and we will continue to work with HUD to convince them this is an activity that not only stabilizes neighborhoods but puts us in a position to build up neighborhoods,” Brown said.

The $30 million received by the city includes money that should have arrived last May but also some funds that should have been spent in prior years but was left over.

A budget is in place for the money from 2012, but the city must decide how to spend the funds from prior years, said Brendan R. Mehaffy, executive director of the Office of Strategic Planning.

Moving responsibility for financial oversight of the grants from BURA to the comptroller’s office has resulted in three new positions in the comptroller’s office. Many of the office’s senior staff members have been preparing for the grants to arrive, and identified 38 areas of concern regarding the HUD grants.

“HUD has been volatile and controversial for 30 years,” Comptroller Mark J.F. Schroeder said last week. “It is not going to disrupt Audit and Control in any way, shape or form. We are as prepared as we can be for this.”

Dominic J. Bonifacio, Jr., president of West Side Community Services on Vermont Street, is hoping for a smoother process next year, but said that nonprofit organizations are used to waiting for government grants.

The community center, which hosts a drop-in center for children and day programs for seniors, receives about $130,000 from the block grant, he said.

“We’ve been getting by,” he said, adding that the center could have done without the money until February or March, though he knows of other agencies that had to take out lines of credit until the federal funds arrived.

Bonifacio is also a member of the BURA board, but said as a former Council majority leader, he recognizes the need for checks and balances.