New York City’s first mayoral debate ahead of the Nov. 7 election devolved into a circuslike spectacle Tuesday night, with the three leading candidates talking over one another, the audience jeering invectives and Mayor Bill de Blasio’s chief bodyguard helping kick one heckler out.

The jeering and cheering drowned out discussions on municipal issues by de Blasio and his long shot rivals, Republican Nicole Malliotakis and independent Bo Dietl. The three jousted over below-market-rate housing, unequal policing, the city budget, homelessness and jail violence, among other issues.

“You’re a lying Big Bird!” said Dietl, a flamboyant former NYPD detective also running on the “Dump the Mayor” line, using his nickname for the nearly 6-6 de Blasio.

The mayor tarred his foes as Trump-supporting conservatives in an overwhelmingly liberal city and defended his tenure as the city’s 109th chief executive.

“I need your help to continue this progress,” de Blasio said to boos from Dietl supporters in the audience at Symphony Space theater on the Upper West Side.

After nearly an hour of unplanned audience participation, moderator Errol Louis ordered a man removed from the theater who called de Blasio a “liar” and told him, “you’re going to jail!” Guards, with the help of the de Blasio bodyguard, ejected the man.

Dietl and Malliotakis, a state assemblywoman from Staten Island, focused on de Blasio. Malliotakis said de Blasio keeps hammering at her vote for Trump last year as a means to “deflect from your lousy record.”

“I’m here to clean up his mess,” she said of the mayor. She declined to disavow her vote for Trump when challenged by de Blasio.

Dietl said he was “sorry” he voted for Trump, calling the president a “lying narcissist,” but criticized de Blasio’s combative stance toward the president. Dietl also chided the mayor for having a strained relationship with Gov. Andrew M. Cuomo, because, he said, it could hinder the city’s ability to receive state and federal resources.

Dietl said voters should pick him over Boston-native de Blasio because of his experience as a businessman and NYPD cop.

“I helped the people of New York City,” Dietl said. “I spread my blood all over New York City.”

Dietl and Malliotakis said they would reject a plan, endorsed by the mayor, to close the Rikers Island jail, criticized de Blasio’s stewardship of the schools, his administration’s efforts to build more below-market-rate housing, and budgeting.

“Do you think the people of New York are idiots out there?” Dietl asked de Blasio. “They know what you’re doing.”

Malliotakis, who has said she would work better with Cuomo than de Blasio does, turned to the mayor early in the debate: “Are you afraid of Gov. Cuomo?”

No, de Blasio answered, adding he was “comfortable” working with the governor.

A Quinnipiac Poll released Thursday found that 61 percent of likely voters would vote for de Blasio, compared with 17 percent for Malliotakis, and 6 percent for Dietl.

Dietl isn’t guaranteed an invitation to the second and final debate, set for Nov. 1. Qualification for the debate will depend on how popular a candidate is in the polls.

Asked for a prediction about the race’s final faceoff, Dietl predicted another brawl.

“There may be a fist fight. I don’t know,” he told Newsday. “Only kidding.”