The NSW Nationals were at risk of being "trumped" in Orange on Saturday night.
Voters in the the once-safe seat punished the NSW Nationals by flocking to the minor Shooters, Fishers and Farmers Party in a byelection that is being seen as barometer of unhappiness with the Baird government's greyhound ban and forced council mergers.
The Nationals had been expected to hold Orange, but record large swings against the party came after the government backed down on the controversial greyhound racing ban in a bid to save Deputy Premier Troy Grant's job as Nationals leader when he faced a party room revolt.
But the swings on Saturday night were worse: at 9pm, with half of the vote counted, there was a 36 per cent swing against the Nationals and up to 60 per cent in some booths.
Shooters candidate Philip Donato (25.2 per cent) was narrowly trailing the Nationals candidate Scott Barrett (28.6 per cent) on primary votes at 9pm.
Labor had handed out how-to-vote cards preferencing the Shooters, giving the minor party hope it could secure the seat on preferences.
Shooters upper house member Robert Brown said the result had exceeded the party's expectations.
"Like the Trump [in the US] election, this is not going to plan, especially for the Nationals," he said.
"I don't know if we will get there, but this will teach the Nationals a lesson. They have to grow a spine and not kow-tow to the Baird government."
The Shooters have two upper house members, but have never held a lower house seat in NSW.
Mr Brown said he observed a level of anger at the booths as voters came in.
"We have had a fantastic campaign. We had 1500 volunteers on the ground in Orange. They came from Victoria, Queensland and north-west and south-east NSW. A lot of greyhound owners were here in their droves. The anti-council amalgamation people sent busloads and we had volunteer firefighters on our booths," he said.
Labor frontbencher Walt Secord said: "This is the end of Troy Grant's leadership ... We may have the unusual position of the Labor Party electing Australia's first lower house Shooters party MP."
At 8pm, Mr Grant said: "This has been a hard-fought campaign and our home-grown candidate Scott Barrett has worked tirelessly. Like everyone, I await the results before commenting further."
2GB radio hosts Alan Jones and Ray Hadley had broadcast live from Orange on Thursday to boost the profile of Mr Donato, who is a police prosecutor, married with five sons.
The decision by Jones to broadcast live from Orange was "unpleasant", said one Nationals insider, but claimed voters were more interested in local issues.
However, the Nationals campaign conceded that forced council mergers had upset voters.
Molong, impacted by forced council mergers, experienced a 60 per cent swing against the Nationals.
The Orange byelection was held after Nationals MP Andrew Gee vacated the seat, previously held on a 21.7 per cent margin, after being elected to the federal House of Representatives.
Labor candidate Sophie Cotsis won the Canterbury byelection, replacing Linda Burney who made the switch to the Federal Parliament.
The Labor seat of Wollongong was retained in another byelection by Labor candidate Paul Scully.