BOSTON (AP) — Four communities that state officials say were short-changed in federal pandemic relief aid will receive a total of $109 million from the federal American Rescue Plan Act, Massachusetts Gov. Charlie Baker announced Friday.

The communities were among the hardest hit by the coronavirus pandemic, but due to shortcomings in the federal funding formula, were set to receive disproportionately smaller amounts of federal funding compared to other hard-hit communities, the Republican said.

“Our Administration committed additional funds to Chelsea, Everett, Methuen and Randolph to ensure all of the Commonwealth’s communities received the funding they deserved from the federal relief package,” Baker said in a written statement.

The money will be distributed to the communities Friday.

The American Rescue Plan Act allocated direct aid to some municipalities based on the federal Community Development Block Grant program formula, while aid to other communities was allocated on a per-capita basis.

The administration said the use of these two different formulas created disparities in distributions. Chelsea, Everett, Methuen and Randolph are the four designated hardest hit communities to receive disproportionately smaller levels of federal funding compared to other hardest hit communities.

Baker earlier in the week had faulted Democratic leaders in the Legislature for delaying funding for the communities as part of a larger spat over how to spend nearly $5.3 billion in federal pandemic aid.

Senate President Karen Spilka and House Speaker Ronald Mariano said they supported distributing the funds to the four communities.

Aides to the two top Democrats released a statement Friday saying Statehouse lawmakers are glad that Chelsea, Randolph, Everett and Methuen are now receiving the additional funds promised to them

“The Senate and House look forward to working with the Administration and the public in an open and transparent process to equitably distribute federal funds,” the aides wrote.

Democratic U.S. Rep. Ayanna Pressley also welcomed the release of the money.

“We are pleased that the $109 million in federal funding that we fought hard for in the American Rescue Plan, and secured a commitment for the Commonwealth to release, was distributed today so that these hard-hit communities can begin to rebuild and recover following the COVID-19 pandemic,” she said Friday in a joint statement with Democratic U.S. Sens. Elizabeth Warren and Edward Markey.

Pressley represents three of the communities — Chelsea, Everett, and Randolph.

The communities can use the money to pay costs related to the COVID-19 pandemic, including direct response efforts, addressing negative economic effects, replacing revenue lost during the pandemic, and making investments in water, sewer, and broadband infrastructure.