A portion of sales from condominiums in Millennium Tower will fund the preservation of the Boston Common and the Boston Public Garden, according to Mayor Marty Walsh.

According to Walsh, The Friends of the Public Garden have reached a deal with Developer Millennium Partners to designate a portion of the funds towards preservation, a compromise that should finalize an ongoing controversy over shadows falling on the Boston Common and the Boston Public Garden.

“The Friends of the Public Garden have worked out an arrangement with the owners of Millennium Tower that when the building is built, they will get some of the money from the sale of these condos that is going to go back into public gardens,” Walsh said Friday in an interview with Boston Public Radio.

The deal will be announced in a bill filed Friday afternoon in the Mass. Legislature.

Back in April, Walsh faced accusations from city councilors that his planning agency misled the council about the controversial project, a 775-foot tower to be constructed in the now-abandoned Winthrop Square Garage.

According to Boston City Council President Michelle Wu, the Boston Planning and Development Agency (BPDA) neglected to mention a shadow the building would cast on the Boston Common and the Public Garden.

The City Council voted 10-3 in favor of a petition to build the tower and shut down the city’s “shadow bank,” a bank to limit the total amount of shadow-casting construction in the city.

“I appreciate the fact that we’re trying to preserve and make sure that our open public space doesn’t have a shadow cast on it,” Walsh told BPR in April, “[But] I’m also looking at an opportunity here to take $152 million and make some major investments in other open space.”

In a written statement, Friends of the Public Garden Executive Director Elizabeth Vizza said the organization, which she referred to as “stewards of the Boston Common and the Public Garden for the last 47 years,” supports the revitalization of the Winthrop Square Garage, but ultimately rejects anything that violates shadow laws. “The state’s shadow laws have worked for nearly three decades to strike an appropriate balance between allowing development to continue and protecting the Boston Common and the Public Garden,” Vizza wrote. “We will take our case to the State House to ensure this balance will not be jeopardized.”

According to Walsh, the Friends plan to drop their opposition in the bill announced later today. “I believe so,” Walsh said. “That’s what I’m hearing. That’s what people have told me.”

To hear the full audio, click on the player above.