The conflicts and betrayals gave this visit important symbolism, said Michael D’Antonio, who wrote a biography of Mr. Trump.

“He feels embattled and threatened. He probably identified with the fighters,” Mr. D’Antonio said. “He’s spoiling for a fight. He wants to punch somebody, but he doesn’t have that person before him.”

Mr. Trump may have anticipated a friendlier welcome from the fans of a sport whose champions have visited him at the White House, where others have declined to do so. But within seconds of Mr. Trump’s entrance, the room was a cocktail of boos, roars and cheers, a din that Mr. Trump was eager to spin in his favor. From his seat, he retweeted his son Eric, who claimed that the arena had been chanting his father’s name (words that were not audible to the reporters traveling with Mr. Trump and sitting nearby), and Donald Jr., who said the reaction was “overwhelmingly positive.” On Sunday morning, Mr. Trump said reports of the booing were “fake news.”

At times, the arena felt like an island in the middle of a city that voted heavily against Mr. Trump in 2016. Some in the crowd wore “Make America Great Again” caps and “TRUMP 2020” shirts, applauding him and giving thumbs-up. At various points, Mr. Trump waved and pointed at followers near his seats.

“He should be a man of the people. He should come and watch them fight,” said Anthony Whealy, who was sitting near Mr. Trump. “You don’t want your president to go and sit around and watch very boring sports.”