Of all the various cabinet hopefuls and assorted hangers-on who have come to Trump Tower to get an audience with President-elect Donald J. Trump, perhaps the least congruous might be the visitor who dropped by late Wednesday morning: Bill de Blasio.

It was, after all, Mr. de Blasio, the liberal mayor of New York City, who had described Mr. Trump during the campaign as a uniquely unqualified candidate for president. Mr. Trump responded in kind, characterizing Mr. de Blasio as the worst mayor in the city’s history.

And yet, Mr. Trump and the mayor spent more than an hour in discussion, alone and without aides, in Mr. Trump’s 26th-floor office, according to City Hall officials. The meeting appeared to be the longest so far between the president-elect and a Democrat other than President Obama, whom he met with for 90 minutes at the White House last week.

Mr. de Blasio characterized the meeting afterward as respectful, a “give-and-take” that was substantive and “very candid.” He said he had gone in with a set of issues and concerns to raise with the president-elect — over immigration, policing and taxation — and a goal of expressing “how much fear there is” among New Yorkers about the direction of his presidency.