BANGOR, Maine — Maine Sen. Geoff Gratwick, D-Bangor, took 56 percent of the vote in his home city, beating out his Republican challenger and former Bangor City Council colleague Cary Weston, 5,427 votes to 4,354.

Results from the other state Senate District 9 town, Hermon, were not provided to the Bangor Daily News as of 1:30 a.m. Wednesday.

“I like Cary,” Gratwick said early Wednesday morning. “Cary’s a good friend of mine, but this vote shows knocking on doors makes a big difference.”

Gratwick said he’s been knocking on doors since last December, at an estimated 6,000 homes.

After the polls closed at 8 p.m., Gratwick, a Bangor doctor, left the Cross Insurance Center in Bangor to go home and have dinner with his wife, followed by a trip to Emily Cain’s election party at the Hilton Garden Inn in Bangor.

Weston, the owner of a small communications and marketing firm, greeted voters at the polls in Bangor and Hermon, with plans to head to Bruce Poliquin’s election event at Dysart’s restaurant on Broadway in Bangor after the last ballots were cast.

Weston and Gratwick worked a three-year term together on Bangor’s nonpartisan City Council. Weston served one term as chairman of that body.

The District 9 state Senate race became contentious at times, but that often resulted from outsiders rather than the candidates themselves.

Gratwick found himself embroiled in controversy in September when the Maine GOP released an edited audio recording in which he said gubernatorial candidate and U.S. Rep. Mike Michaud was “not a brain guy” and that in a head-to-head vote he would pick independent Eliot Cutler over Michaud. Republicans ran with that statement in hopes of swaying voters away from Michaud.

Gratwick ran as a publicly financed Maine Clean Election Act candidate, meaning that his campaign was limited in how much it could spend. However, that did not preclude outside groups from spending on his behalf. And spend they did.

Late in the campaign cycle, expensive anti-Weston ad buys by the Maine Democratic Party targeted Weston’s use of his own marketing company to produce and print his own campaign materials. Weston is running a privately funded campaign and has said he doesn’t agree with using taxpayer money to finance elections.

Asked what he thought of his party’s advertising efforts, Gratwick said, “I have no control over that I much prefer to talk about issues.”

Weston countered the advertising with videos on social media decrying what he called misleading and negative claims.

Still, Gratwick and Weston found some common ground during this campaign, likely because they served on the same council for three years and became so invested in the challenges of municipal government.

For example, both men support the expansion of Medicaid, which separates Weston from most Republicans who served in the latest Legislature. Both candidates also believe that the governor shouldn’t be allowed to delay the sale of voter-approved general obligation bonds.

The pair differ widely elsewhere, with Weston placing a lot of focus on welfare reform, saying, “Programs need to protect single moms and children. Too much money is going towards funding drug dealers.”

Gratwick would support legalizing and taxing marijuana, whereas Weston would oppose such a measure. Weston also supported charter schools, whereas Gratwick believes they could be too costly and should be carefully studied.

Watch bangordailynews.com for updates.

Follow Nick McCrea on Twitter @nmccrea213.