State Sen. Liz Lovelett, D-Anacortes, led a field of four candidates Tuesday night in a special state Senate primary election for Washington’s 40th Legislative District.

Tuesday’s results put Lovelett comfortably ahead with nearly 48% of the vote and Republican Daniel Miller in second place with 30%. Democrats Carrie Blackwood had about 21% and Greta Aitken earned less than 2 percent.

Additional ballots will be counted Wednesday.

The election is being held to fill the seat opened up by Democratic Sen. Kevin Ranker, who resigned in January after allegations that he harassed a female legislative employee who formerly worked for his office.

An investigation found Ranker harassed that employee, and after she found a job at a state agency, he created “a hostile, intimidating or offensive work environment” related to her new job. Ranker in the report denied making specific sexual overtures, “but he conceded that their office dynamic was occasionally flirtatious and unprofessional.”

The 40th district covers San Juan County and chunks of western Skagit and Whatcom counties, including Anacortes and part of Bellingham.

Lovelett, a former Anacortes City Council member, was appointed in February to replace Ranker. She touts her experience in elected office and commitment to environmental policy that also helps blue-collar workers.

Election 2019: Full coverage

Miller unsuccessfully ran for the Legislature in 2014, 2016 and 2018.

A landscaper who also works in the antiques market, he has campaigned on cutting waste from state government and opposing new taxes. He has chosen to run for office under a provision where he doesn’t have to release campaign-finance reports as long as he doesn’t raise and spend more than $5,000.

Blackwood, an attorney focused on labor and employment law, hoped to mount a serious intraparty challenge to Lovelett. In response, a political-action committee funded, in part, by the Democratic Party put more than $75,000 into an independent campaign to support Lovelett.