Labor has claimed victory in the New South Wales seat vacated by disgraced MP and convicted rapist Gareth Ward.

The Kiama byelection was held on Saturday to replace Ward, who was convicted of sexual and indecent assault in July.

Labor had held the seat for three decades after its creation in 1981 until the then-Liberal MP Ward claimed it in 2011.

ALP candidate Katelin McInerney’s victory was the first major electoral test for the Minns government.

The premier, Chris Minns, said the result was humbling.

“My government views this result as an invitation to work even harder for the entire state,” he said on Saturday night.

“I want to thank the people of Kiama for putting their trust in Labor. We do not take that trust for granted. Kiama now has that voice inside government and I know Katelin will be a fierce advocate for her community.”

There were 13 candidates vying for votes on Saturday. Election analyst Ben Raue called the win for Labor two hours after the polls closed.

It is unusual for a government to gain a seat in a byelection, but Raue said Labor had more incentive to work harder for the victory. The win puts Labor one vote closer to majority power.

The count on Saturday by 10pm had the ALP candidate securing 60.6% of the two-party preferred vote over the Liberal’s Serena Copley on 39.4%.

The fate of the state opposition leader, Mark Speakman, could be tied to Saturday’s poor performance.

Asked on Friday if his leadership would survive a loss, Speakman batted away the speculation.

“We are the underdogs,” he told reporters in Kiama ahead of the byelection.

“I will be the leader. I will continue to be the leader. It’s about the best representative for Kiama … it’s about electing someone who will take the toughest fight up to the government.”

But it had been suggested that if the Liberals had a two-party preferred result in the low 40s, or worse, then Speakman would be in trouble. Even though who might mount a leadership challenge remained unclear.

McInerney had secured 37.5% of first preference votes late on Saturday night, while Copley had just 26.2% of the primary vote, with 75% of the ballots counted.

Ward retained Kiama as an independent in 2023 despite having been charged with sex offences against two young men. He resigned in August on the morning parliament was going to expel him. He is due to face a sentencing hearing next week.

Minns said Saturday’s byelection drew a line under the disgraced MP’s time in office. “Now it’s about turning the page,” the premier said.