INCUMBENT GOVERNOR’S Councilor Marilyn Devaney narrowly edged out Democratic activist and attorney Mara Dolan to hold on to the seat she has held for 23 years.

Dolan gave Devaney her toughest competition since Devaney first won the seat in 1998. Devaney represents District 3, which includes the suburbs west of Boston. The Governor’s Council ratifies judicial appointments.

A winner in the Democratic primary race was not clear until midday Wednesday. Dolan called Devaney to concede after 1 p.m. With the town of Southborough yet to announce its results, Devaney led by 1,440 votes out of 98,000 votes cast. With no Republican running in the general election, Devaney retains her seat.

Dolan, in an interview, pledged to run again. “I will be back,” she said.

Particularly in down-ballot races when candidates are not well-known, there is a power of incumbency. No incumbent governor’s councilor has lost their seat since 2014, when Joe Ferreira unseated Oliver Cipollini.

Devaney said she regrets that Dolan ran what she called “a vicious smear campaign that really destroyed the record that I hold dear.” She added: “I had a positive campaign, I talked about my record and the positive things that I’ve done.” (Dolan denied that she smeared Devaney and said it was Devaney who made false accusations about her.)

Devaney said she was meeting with a judicial nominee on Wednesday. “I don’t stop working,” she said.

Although she lost, Dolan said she believes her campaign was “a spectacular success.” She won in 14 towns that voted for Devaney the last time she had an opponent, including Devaney’s hometown of Watertown. She also believes she raised the profile of the Governor’s Council. “We came much farther than anyone thought we could, and we did it in five months,” Dolan said.

Dolan said she thinks Devaney was helped by the power of incumbency and a “lack of awareness” about the race and the issues. “People who knew about this race, know about my candidacy and the incumbent’s record supported me,” Dolan said.

Dolan trounced Devaney in Dolan’s hometown of Concord, and narrowly bested Devaney in Watertown. Dolan also did well in Acton, Arlington, and Lexington. Devaney won in Boston and picked up large numbers of votes in Billerica, Burlington, Chelmsford, Waltham, Newton, Marlborough, and Woburn.

Dolan raised more than $50,000 toward her campaign this year, much of it from attorneys. Devaney apparently did not fundraise, reporting just $700 in contributions this year, of which $500 came from the Professional Firefighters of Massachusetts.

Devaney is one of few governor’s councilors who is not an attorney. She has touted her ability to work as a full-time councilor and meet personally with every nominee. But she has also been a colorful character, often getting into public spats with her colleagues.

Dolan, a public defender, focused her campaign on the need to confirm judges who understand the science of addiction and recovery, who respect that juveniles should be judged differently than adults, and who treat all defendants fairly. She secured significant endorsements, including from US Rep. Seth Moulton, Auditor Suzanne Bump, and outgoing Governor’s Councilor Mary Hurley. Dolan previously worked for Senate President Stan Rosenberg, helped US Sen. Ed Markey’s campaign, and founded a Democratic campaign consulting group, Left of Center, that helps Democratic campaigns nationwide.

This story was updated with Dolan’s response to Devaney.