Boston mayoral candidates skirmished Thursday night over how city government should manage the prospect of a casino in East Boston, criticized Police Department leadership, and wrangled over public education in the final big-ticket forum before next Tuesday’s preliminary election.

Divided over whether the entire city should cast a referendum vote on the casino deal or whether the ballot should be confined to East Boston, candidates also voiced skepticism about the mitigation package designed by state policymakers to address financial costs and social ills expected to arrive with a casino.

The gambling discussion contained the evening’s sharpest exchange, when former health care executive Bill Walczak criticized his rivals for failing to more stridently oppose the casino.

“OK, you stopped the casino. Congratulations. But now we have a casino 7 feet from the neighborhood of Charlestown,” Councilor Michael P. Ross shot back, referring to a separate proposal to build a casino in Everett.

Yoon S. Byun/Globe staff

Audience members watched a monitor projecting the candidates at the forum.

Get Fast Forward in your inbox:

Forget yesterday's news. Get what you need today in this early-morning email.

Polls show the race, the city’s first for an open mayoralty since 1993, to be tightly bunched, with none of the candidates able to forge a dominating lead. Connolly has consistently led by narrow margins in both public and private polling.

Recent polls have slotted Conley, former state representative Charlotte Golar Richie, and state Representative Martin J. Walsh shortly behind Connolly. But the spread among them has been narrow, and that trio is only edging the next few candidates by a few percentage points.

The tight polls and the unpredictability of the electorate’s size and composition has forged agreement among the campaigns that are within striking distance of surviving next Tuesday: To make the cut, they will need to prove they can get supporters to the polls. The campaign with the strongest get-out-the-vote operation will be well positioned to get a slot on the November general election ballot.

Thursday’s forum probably marked the final time all the candidates will appear together before Tuesday’s preliminary election.

The two-hour session laid bare a challenge with which candidates have grappled throughout the race. With Mayor Thomas M. Menino continuing to enjoy lofty approval ratings, candidates have largely shied away from criticizing the mayor directly.

Instead, attacks against the administration have frequently been aimed at the Police Department. Asked whether they would keep Police Commissioner Edward F. Davis, only three candidates — Walczak, Councilor at Large Felix G. Arroyo, and Conley — said they would retain him. Six — Connolly, nonprofit executive John Barros, Golar Richie, Ross, and Walsh — said they were undecided or would conduct a review before deciding. Councilor Charles C. Yancey and radio station cofounder Charles Clemons said Davis should go.

The candidates were more united in criticism of the department’s record of promoting women and minority officers. Barros faulted the current system of relying on the civil service exams used to decide on entry into the ranks and promotions within command, calling it an improper tool for selecting leadership.

While Menino himself was cited only with gentle indirect barbs, the candidates were nearly unanimous in finding fault with the city’s shortage of housing for low-income and middle-income residents.

Boston’s public education system, a dominant issue throughout the campaign, also received harsh grades. Walsh said that the system features 80 buildings constructed between 1870 and 1927, adding that in schools where 87 percent of the students are of color, less than 20 percent of the teachers are.

He called for a modernized physical plant with a faculty that more closely matches the demographics of the student body.

Aired on WBUR and livestreamed online at various sites, the forum failed to draw a full house to the UMass Boston Student Center, where organizers said they expected about 450 people.

Tightly moderated by WBUR hosts Meghna Chakrabarti and Bob Oakes, the format permitted little back-and-forth, a restriction that has been a constant throughout the campaign, due to the 12-person field.

Before the forum started, attendees were greeted by Walsh supporters holding campaign signs in an arc that stretched around nearly half the UMass Boston’s circular driveway, a show of force that dwarfed that of any other candidates.

Conley and Yancey arrived late to the forum, missing the opportunity to deliver opening remarks.

Councilor Rob Consalvo and former school teacher David Wyatt did not attend. A spokesman said Consalvo was meeting with campaign volunteers in Mattapan.