BANGOR, Maine — For the second time in nearly 14 years, Bangor City Councilor David Nealley was paid to advocate for a casino tied to Shawn Scott, the gaming magnate who bankrolled a campaign to kick off what became Hollywood Slots and who is linked to another bid to get voters to allow a third Maine casino.

Nealley was paid $4,926.92 to take part in two September 2016 debates in which he supported a referendum asking Massachusetts voters to allow a casino license for a slots parlor in Revere, just north of Boston. The effort failed.

Nealley said he didn’t violate Bangor’s code of ethics, which prevents city councilors from using their “authority or position for the purpose of influencing or interfering with or affecting the results of any elections,” because he was paid to debate the issue because of his experience advocating for casinos, not his status as a Bangor councilor.

Bangor City Solicitor Norm Heitmann agreed, but an open government expert said he may have been toeing a fine ethical line.

“I think this instance shows the importance of strengthening conflict-of-interest laws so the public can connect the dots between official actions that elected officials are taking and private businesses that might be benefiting,” said Aaron Scherb, director of legislative affairs of the government watchdog group Common Cause. “Even if it’s not technically illegal by the letter of the law, it looks bad and smells bad and situations like this can erode the public trust and faith in government.”

Nealley said he was enlisted to debate by a person working with Scott’s sister, Lisa Scott, who helped run a campaign funded by Scott-linked companies that spearheaded the 2003 referendum in Maine. While a city councilor then, Nealley was a corporate officer for Capital Seven, one of those companies. He left the council in 2004 and returned in 2012.

During a Sept. 27 debate at the University of Massachusetts at Boston, Nealley was introduced by moderators as a Bangor city councilor, not mentioning his experience with Capital Seven. He noted that the Hollywood Casino brought millions in taxes to Bangor, allowing the city to transform its downtown, waterfront and civic center.

“I didn’t get a speaking fee because I’m a councilor,” Nealley said. “I got a speaking fee and a debate fee because I knew the art of the business. They’ve worked with me before.”

Nealley said he had no other involvement with the Revere campaign. He said this was the first time he had worked with Scott or on casino projects since 2004, and he said he had previously reviewed potential Revere conflicts with Mayor Joe Baldacci and Heitmann, saying both called it “a non-issue.”

Baldacci, however, denied knowing about Nealley being paid to debate there.

“This is the first I’ve heard of it and I would like to speak to Councilman Nealley before I make any comments,” he said.