Jeff Bezos, founder and CEO of Amazon, speaks to a group of Amazon employees that are veterans during an Amazon Veterans Day celebration on Monday, November 12, 2018.

Amazon held 11th-hour meetings with New York and trade union officials before pulling the plug on its Long Island City headquarters.

Amazon executives met Wednesday morning with union officials from the Retail Wholesale and Department Store Union, according to a spokesperson for the group. Representatives for the AFL–CIO, a national federation of more than 50 labor unions, and the New York state Teamsters also attended, according to Stuart Appelbaum, head of the RWDSU.

New York Gov. Andrew Cuomo hosted the meeting and proposed a framework for moving forward that would allow Amazon to build in Long Island City and work more cooperatively with the unions, Appelbaum said.

"The meeting seemed to be very productive. We shook hands and said we look forward to working with each other, Appelbaum told CNBC. "It was a complete surprise the next morning."

The parties had agreed to stipulations of fair union election, hostility and retaliation free environments, and access for the unions to communicate with workers, Appelbaum said.

"I think the anger is about the way the whole process was done, that Amazon did it in a way that ignored the communities, that ignored the communities, ignored stakeholders, shrouded the whole process in secrecy," he said. "They do not listen. They do not listen to anybody's concerns. They refuse to even discuss what these concerns are."

Bloomberg and The New York Times first reported the meeting.

Amazon executives had earlier drawn criticism from local officials after saying it would continue to discourage employees from unionizing. Now, the city stands to miss out on the majority of the 25,000 jobs that were promised.

The decision to cancel plans for thousands of jobs and billions of dollars in economic investment came as a shock to some government officials and residents. Amazon spent nearly a year fielding proposals from municipalities across North America, made a final decision in November, and apparently deliberated up to the last minute on whether to continue with the plans despite political opposition.

Representatives for Amazon and Cuomo did not return a request for comment from CNBC.

Read more at Bloomberg or The New York Times.

Subscribe to CNBC on YouTube.