BOSTON - Five Democratic and independent candidates running for governor all said Wednesday night they support a way to allow undocumented immigrants in the state to obtain driver’s licenses.

Attorney General Martha Coakley, the Democratic frontrunner in recent polls, said she has slowly shifted away from her opposition to the proposal.

“In the past, I have been opposed to that,” she said. “But people who have to get to work or have medical emergencies, we clearly have to find a way to do that.”

From English-language classes to racial profiling and the implications of the Secure Communities program, a forum Wednesday night at Bunker Hill Community College got six gubernatorial candidates to stake out their turf on issues affecting immigrants across Massachusetts, who now number more than 1 million people and 15 percent of the state’s population.

Republican frontrunner Charlie Baker did not participate in the forum, citing scheduling conflicts.

It was hard to discern sharp differences on immigration policies among the Democrats and independents, all of whom mostly agreed on the need for more seats in English classes and embraced plans for more economic opportunities for new immigrants.

Some grist in the discussion came from Baker’s challenger, tea party Republican Mark Fisher of Shrewsbury, who was the sole voice against driver’s licenses for undocumented immigrants.

“It’s a touchy and emotional subject,” said Fisher, who talked about a woman whose son was killed in a car accident.

“It was an illegal immigrant at the wheel,” he said. “If he was prevented from coming here illegally, this poor woman’s son would still be alive.”

Other candidates used the exact opposite logic, saying that concern for public safety alone should convince voters to back driver’s licenses for undocumented immigrants.

“Every immigrant should have a right to a driver’s license,” said state Treasurer Steven Grossman, a Democrat trailing Coakley by 27 percentage points in recent polls.

“This is a fundamental issue of decency, and it’s a public-safety issue. We have people who have go to work, and they drive. They need to go to the supermarket and shop and take their kids to a doctor’s appointment,” he said.

Grossman, one of the more outspoken candidates on immigration, also said he backed in-state tuition at state colleges and universities for all immigrants.

Don Berwick, a Newton pediatrician and the former administrator of the Centers for Medicare and Medicaid, pointed to the economic power of immigrants.

“Immigrants are a mainstay of our economy. Sixty percent of new businesses are started by first-generation immigrants,” said Berwick, running as a Democrat in the Sept. 9 primary.

Page 2 of 2 - In the last month, polls testing the waters of a potential final match-up showed Coakley pulling ahead of Baker 42 percent to 31 percent. Less than four weeks ago, Baker was in a near-tie with Coakley, polling at 36 percent compared to her 39 percent.

Polls have shown that voters’ support for independent candidates Evan Falchuk of Auburndale and Jeff McCormick of Boston remains in the single digits.

Chris Burrell may be reached at cburrell@ledger.com or follow on Twitter @Burrell.