From the beginning, Mr. Gillum has insisted that a corruption inquiry in which he said he played no direct role should not be an impediment to his campaign for governor. But he acknowledged that the investigation has rocked city government in Tallahassee since federal authorities delivered their first subpoenas in the case last summer.

“What kept me going even through that difficult time was my knowledge that I would never do anything to compromise my morals, my values, my family, my children, my vote,” Mr. Gillum said in an interview this week. “I was very clear in that, which is why I was not afraid to keep going on the trail, keep answering questions, continue to take it on the chin.”

At issue is a vote in June 2016 to expand a city redevelopment district to include properties the undercover agents posing as developers said they wanted to invest in if the properties became eligible for public dollars. It would have been unlawful for public officials to accept money or other consideration from the purported developers in exchange for favorable votes.

Mr. Gillum was not present for the vote that approved the boundary change. But the investigation revealed that he had spent time socializing with Mr. Corey, the lobbyist, and the undercover agents in New York, including taking a boat ride to the Statue of Liberty and seeing a Broadway performance of the hit musical “Hamilton.”

[Tallahassee residents received racist robocalls targeting Andrew Gillum.]

Mr. Gillum and Mr. Corey met in college, when they were involved in student government at Florida A&M University and at Florida Gulf Coast University, respectively. They remained friends — Mr. Corey served as Mr. Gillum’s volunteer campaign treasurer in his 2014 run for mayor — until the investigation; Mr. Gillum told The Tallahassee Democrat that he has severed ties with Mr. Corey.

The trip to New York in August 2016 raised questions of why the mayor was spending personal time with developers who had potential business before the city. Similar questions resulted from another trip that Mr. Gillum took with his wife and several lobbyist friends — including Mr. Corey — to Costa Rica in May 2016.

Mr. Gillum’s campaign said in response to written questions on Friday that the “Hamilton” tickets and the mayor’s hotel stay at the Millennium Hilton hotel in Downtown Manhattan were paid for by his younger brother, Marcus Gillum, who was on the New York trip. The brothers attended the musical along with Mr. Corey and one of the undercover agents. The ticket Marcus Gillum gave his brother was in exchange for a Jay-Z concert ticket Marcus Gillum gave Mr. Corey, Andrew Gillum later learned. Marcus Gillum could not be reached for comment.