In an embarrassing setback for New York City Mayor Bill de Blasio on Thursday, his choice lead the city’s school district publicly turned the job down on live television.

The drama unfolded at what was called an emergency meeting of the Miami school board, with parents and students pleading with Superintendent Alberto Carvalho to remain in the job and not move to New York City to replace Carmen Fariña as schools chancellor.

Carvalho responded with the soaring rhetoric perhaps more suited to a politician in a meeting that unfolded much like a major sports star deciding whether to stay in his hometown or leave for a more glamorous team.

In the end, Carvalho decided to keep his talents in South Beach — in a public display that unfolded for city dwellers and its political class on NY1.

“The decision that I have made, however, is a decision I can no longer sustain,” he said after taking a second recess to call the mayor’s office and inform him he was backing out of the job. “I am breaking an agreement between adults to honor an agreement and a pact I have with the children of Miami.”

The decision to remain in Miami appeared to have catch the mayor’s team off guard.

De Blasio spokesman Eric Phillips at first on Twitter noted the soaring speech Carvalho was delivering as a good thing, but later told reporters to “give us a minute” in order to sort “through the weirdness” of Carvalho’s Hamlet-on-the-beach display.

Later, after Carvalho’s intentions were made clear, Phillips’s tweets took a turn.

“Who would ever hire this guy again?” he wrote. “Who would ever vote for him?”