The Nationals' David Layzell looks set to defy history and hold Upper Hunter for NSW's coalition government, but it may be days before a winner is declared in the crucial by-election.
The major parties are sweating on the result, which could push the Berejiklian government into minority, or increase pressure on Jodi McKay's position as opposition leader.
By-elections have historically proven difficult for sitting governments to win, so the poll is an important test for Ms McKay as Labor leader.
Her position has been under pressure and a failure to win could push her leadership to the brink.
With more than 30,000 votes counted late on Saturday, Mr Layzell was polling above 30 per cent of first preference votes, with Labor's Jeff Drayton on 20 per cent.
One Nation's Dale McNamara and Shooters Fishers and Farmers' Sue Gilroy were both on about 13 per cent, while Independent Kirsty O'Connell was polling under 10 per cent.
The contest is likely to come down to preference flows from the 13 candidates, with neither the Nationals nor Labor likely to win the seat outright.
Delays are expected due to the high number of pre-poll votes, with some 23,000 votes cast early.
The Nationals had held the seat by 2.6 per cent, before MP Michael Johnsen's resignation over sexual assault allegations and a sexting scandal prompted the by-election.
Mr Johnsen denies the allegations and has not been charged.
The by-election contest has centred on the future of coal mining in the region, with the Greens' Sue Abbott and Ms O'Connell wanting to move the region away from its reliance on coal.
But Labor and the Nationals have talked up their coal credentials, and Labor's Mr Drayton is a former coal miner.
In a last-ditch appeal to voters, Mr Drayton said he would fix years of neglect suffered under the Nationals, who have held the seat for more than 90 years.
"I'm ready to go - ready to go to Macquarie Street and fight for people of the Upper Hunter's fair share," he said while campaigning on Saturday.
Labor has come close to winning the seat before, and hopes to rely on a history of by-election swings against governments.
But Premier Gladys Berejiklian pointed out the Nationals candidate is the only one of the 13 that would actually be part of the government if elected.
"We do need a strong team in government (and) I do rely on great local members," she said alongside Mr Layzell in Muswellbrook.
"As premier you'd like to think you're in every corner of the state every day but you can't be."
If the government loses Upper Hunter, it will have the tricky task of managing minority government until the next election, which isn't due until March 2023.