The company had threatened to move to New Jersey while local residents created an organization to stop them from moving to their borough. But the owners of FreshDirect got what they wanted: a new location in the five boroughs and help from the government to build it.

In August, New York City Mayor Michael Bloomberg approved $89 million in city funds directed toward FreshDirect, and another $38 million in subsidies from the Bronx and New York state will go the online grocer’s way as well. FreshDirect hopes to build its headquarters in Port Morris by next spring and build a parking lot in the area of the Harlem River Yards that had been reserved for a rail hub.

Technically, that kind of request would need the approval of the City Planning Commission along with the mayor. The news comes off of FreshDirect’s threat to move the company to New Jersey after it claimed that it had outgrown its current location in Long Island City, Queens.

A group of local residents and activists in the Bronx, South Bronx Unite Stop Fresh Direct, protested the grocer’s move for environmental and health reasons, but their ire has only grown after the subsidies were introduced. Earlier this year, an anonymous email was sent to the AmNews criticizing Majora Carter and citing a New York Times piece that they felt implicated the Majora Carter Group, Carter’s consulting firm hired by FreshDirect in 2012, for engaging in lobbying activities on behalf of the grocer and advocating its presence in the local community. Carter rose to prominence as an advocator of environmental justice in the South Bronx.

A lawsuit filed in opposition to FreshDirect’s move to the South Bronx was dismissed in court earlier this year. Bronx Borough President Ruben Diaz Jr. expressed gratitude over the ruling and looked forward to the jobs he believes FreshDirect will bring to the Bronx.

“I am thrilled to learn that the plaintiff’s legal efforts to thwart FreshDirect’s relocation to our borough have been stopped and their lawsuit has been dismissed,” said Diaz in a statement earlier this year. “My office has, since day one, understood that this project is crucial to the future economic health and vitality of the Bronx.”

FreshDirect hopes to have the 500,000-square-foot waterfront facility in full operation by 2016.