Miles from the rather somber Manhattan courtroom where he has spent much of the past five weeks as a criminal defendant, former President Donald J. Trump on Thursday stood at a park in the Bronx, surveyed the crowd and acknowledged he had been concerned over how he might be greeted at his first rally in New York State in eight years, and his first ever in the borough.

In front of him was a more diverse crowd than is typical of his rallies, with many Black and Hispanic voters sporting bright red “Make America Great Again” hats and other Trump-themed apparel ordinarily scarce in deep-blue New York City. Still more people stood outside, waiting to get past security.

“I woke up, I said, ‘I wonder, will it be hostile or will it be friendly?’” Mr. Trump said. “It was beyond friendly. It was a love fest.”

As is often the case during Mr. Trump’s speeches, the truth was a bit more complex. As he spoke, more than 100 protesters demonstrated outside the fenced-off area of Crotona Park where he had staged the rally. A wave of elected officials denounced his visit to the city. And his insistence that he would carry New York in November — though perhaps not as laughable as it once might have sounded, judging from at least one recent poll — conveniently disregarded the thumping he took in the state in the 2016 and 2020 elections.

But as heated arguments took place outside his rally, Mr. Trump, who veered occasionally into lengthy New York-focused reminiscences that were lost on his supporters, seemed to relish the chance to appear in his hometown, seize media attention and know that New Yorkers would hear what he had to say, like it or not, one way or the other.

Throughout the rally, Mr. Trump, one of New York’s most famous native sons, who formally made Florida his home in 2019, embraced the chance to demonstrate his support in the city he left behind — and which he swore he still loved, even as he decried it as descending into chaos.