The superintendent of schools for Miami-Dade County shocked New York City officials on Thursday by backing out of an already announced agreement to lead the city's 1.1 million-student public school system.

Superintendent Alberto Carvalho told an emergency school board meeting in Miami that he was breaking his agreement with New York City to honor "an agreement and a pact I have with the children of Miami."

"I underestimated the emotional tug, the level of commitment, the power that crying members of the community have had on me," Carvalho said.

The move stunned New York City Mayor Bill de Blasio. "You can imagine how surprised I was to get a phone call from him a few hours ago," de Blasio said at a news conference.

De Blasio said he had spoken with Carvalho at 8 p.m. Wednesday and "all systems were go."

A spokesman for de Blasio blasted Carvalho earlier on Twitter.

"He was a Yes for a week+, until he was a No 15 minutes ago," spokesman Eric Phillips tweeted Thursday. "Bullet dodged."

A follow-up tweet asked, "Who would ever hire this guy again? Who would ever vote for him?"

The turnaround came after de Blasio announced the choice of Carvalho to lead the city's schools the day before.

"Alberto Carvalho is a world-class educator with an unmatched track record of success," de Blasio said in a news release Wednesday. "I am very confident that our extensive, national search has found New York City the best person to lead the nation's largest school system into the future."

Carvalho would have succeeded Carmen Farina, who announced her retirement from the New York City schools chancellor post in December.

De Blasio said Farina will stay until the end of March. He said the search for a new chancellor has already resumed.

Carvalho, 53, has led the Miami-Dade system for 10 years.

He announced his change of heart after members of the community who packed the Miami school board auditorium pleaded with him to stay.

Carvalho denied that his decision was prompted by any friction between himself and de Blasio, saying that he and the Democratic mayor had been in agreement on issues like gun control and immigration policy. "We felt like kindred spirits," he said.