PORTLAND, Maine — State Sen. Cynthia Dill pulled ahead of former Secretary of State Matt Dunlap for the Democratic nomination to run for the U.S. Senate as statewide election results were compiled Tuesday night.

Dill claimed victory in the primary race about 11:35 p.m. during a speech to supporters at a Democratic Party event in Portland.

With more than 88 percent of the state’s precincts reporting by about 8 a.m. Wednesday, Dill had 45 percent of the vote compared with Dunlap’s 35 percent in the four-way race. Jon Hinck had 13 percent of the Democratic vote and Justin Benjamin Pollard had 7 percent, according to unofficial results tabulated by the Bangor Daily News.

“I hope that the conversation about the bread-and-butter economic issues that matter to working Maine families, which our campaign has worked so hard to engage in, will continue throughout the general election and beyond,” Dunlap said in a statement.

Dill and Republican Charlie Summers will face former independent Gov. Angus King and three other nonparty candidates in the November election.

Turnout was predicted to be extremely light and as the results came in about an hour after the polls closed it looked like a tight contest between Dill and Dunlap. Dill congratulated Dunlap and the other two candidates for running positive campaigns.

“We as a party established to the state of Maine and the country how elections can be run,” said Dill, flanked by her husband, Tom Clarke. “There was nothing negative. There was a robust exchange of ideas. We’ll be friends going forward and I want all of us to stand together.”

Dill said she would campaign for the U.S. Senate seat vigorously and took aim directly at King.

“As the standard-bearer of the Democratic Party I will take so seriously my responsibility to you and our party,” she said. “There are better days ahead for Democrats in the U.S. Senate so join with me and let’s win this thing. And I say to Angus King, bring it on.”

Pollard, who was trailing the other Democratic candidates by wide margins, said Tuesday night that he was pleased with the approximately 8 percent of the vote he had received so far and planned to continue the campaign for U.S. Senate as a write-in candidate.

“It looks like I am not going to win the primary, but I would definitely like to stay involved,” said Pollard during a telephone interview from his home. “I feel like what we need is not an independent senator from Maine but someone who can reform the Democratic party. One thing I don’t do is toe the party line.”

Asked whether he is concerned that his write-in candidacy would siphon votes from another candidate, making him a spoiler, Pollard said he suspects he could attract as many Republican and independent votes as Democratic ones. If early November rolls around and it’s clear Pollard has no chance of winning the election, he said he’d bow out and endorse another candidate.

“This is just a way for me to continue campaigning,” said Pollard.

Geography played a large role in the race. Dill had a stronger showing in southern Maine, while Dunlap lead in Aroostook, Piscataquis and Penobscot counties.

Dill, a lawyer from Cape Elizabeth who has served in the Maine House and Senate, said during the primary campaign that she is a strong supporter of most traditional democratic values and like the other candidates pledged to work against political gridlock in Washington. She has said she is a supporter of same-sex marriage, ending the prohibition on marijuana and favors a single-payer health care system as opposed to the Affordable Care Act championed by President Barack Obama.

Dunlap, a former legislator from Old Town, also served as Maine’s secretary of state and for a brief time led the influential Sportsman’s Alliance of Maine. Dunlap has campaigned primarily on his ability to work with people and organizations toward solutions as opposed to sticking firm to political ideology. He has said that one way to create jobs in the United States is to recraft foreign trade agreements with other nations in a way that doesn’t put domestic businesses at a disadvantage. Dunlap said he hopes the Affordable Care Act withstands its challenge in the U.S. Supreme Court, which is to be heard this summer.

Hinck, a lawyer from Portland and member of the Maine House of Representatives, openly acknowledged during the campaign that he doesn’t match the level of political experience of some of the other candidates in the Democratic primary but said his professional experience as an attorney involved with suits against petroleum and pharmaceutical companies has taught him how to take on tough opponents. He supports the Affordable Care Act and said he supports federally backed job stimulus bills.

Pollard, a contractor from Portland with no political experience other than serving on a local planning board, touted that as one of the reasons why voters should send him to the U.S. Senate, to end insider politics and gridlock on Capitol Hill. Pollard attempted to cast himself as the most fiscally conservative Democrat in the primary race and outlined several ways that he differs from traditional Democratic values.

Dill visited polling places in Saco, Waterville, Portland and South Portland on Tuesday, greeting voters. She said she had heard from a number of voters who made late decisions to vote for her.

“Not only had they not made a decision, they just hadn’t been focusing on the race,” she said.

Democratic voters in Waterville interviewed by the Bangor Daily News seemed largely to lean Dill’s way, but not due to unbridled enthusiasm for her candidacy.

“I guess she was the person whose name I recognized the most,” said Rebecca Green.

“I will confess I don’t have strong feelings,” she added. “I do hope a Democrat takes back the seat.”

Charlie Kellenberger said he voted for Dill because of name recognition.