The NSW Nationals have retained the regional seats of Cootamundra and Murray in state by-elections held on Saturday, however big swings away from the party have turned its once safe seats into marginal electorates.

There were three by-elections on Saturday, in Cootamundra and Murray as well as Blacktown in Western Sydney — which was won easily by Labor.

Voters were forced to go to the polls after the mid-term resignations of Nationals MPs Katrina Hodgkinson and Adrian Piccoli, and the former Labor Leader John Robertson.

In the seat of Cootamundra, Nationals candidate Steph Cooke received more than 45 per cent of the primary vote — but there was a swing of about 20 per cent away from the party.

In Murray, the Nationals' Austin Evans defeated the candidate from the Shooters, Fishers and Farmers Party — however a swing of about 15 per cent was recorded against the party.

Labor candidate Stephen Bali claimed victory in Blacktown in Sydney's west, in which the Liberal Party did not field a candidate.

'We accept there has been a message'

Nationals Leader John Barilaro has blamed the swings away from the party in regional NSW on a by-election protest vote and several "legacy" issues he inherited.

"This is the first test of my leadership. I think from a government perspective it has been the first test for both the Premier and myself," Mr Barilaro said.

"You know, a victory is a victory, but we accept there has been a message.

"There has been a significant swing against the government of the day and we will take that on board and we will work even harder."

Labor's Stephen Bali (centre) easily retained the seat of Blacktown for the Opposition leader Luke Foley (right). ( ABC News: David Spicer )

NSW Opposition Leader Luke Foley said the big swings demonstrated that there was a great deal of anger towards the Government.

"Thumping swings against the Nationals, against the Government in those safe country electorates which are now very marginal seats," Mr Foley said.

"This shows there is a real mood for change in the electorate amongst people right across NSW and we will be working very hard over the next 18 months to earn the confidence of the people as we head to the next state election," he said.

'Not as bad as Orange': Antony Green

In last year's Orange by-election, a loss for the Nationals was the catalyst for the resignation of the party's then leader Troy Grant.

However, ABC election analyst Antony Green said the voter backlash recorded against the Nationals was not nearly as severe as it was in Orange.

"The Orange result was a disaster for the National Party; they lost over half of their first preference vote, so much that they lost to the Shooters and Fishers on preferences," he said.

"It was the biggest swing against a party at a by-election in decades.

"These by-elections, while also big swings, they certainly were not as bad as the Orange result.

"It certainly shows that haemorrhaging that was occurring at the end of last year over the greyhound ban and local government amalgamations has subsided since then."

Dirty tricks alleged by Shooters

Claims of dirty tricks at a polling booth at Young in the seat of Cootamundra are being investigated by the NSW Electoral Commission.

The Shooters, Fishers and Farmers Party complained that a Nationals' staff member was handing out a letter co-signed by the former prime minister John Howard — which had not been pre-registered as official campaign material.

A Nationals Party staffer with NSW Electoral Commission officials in Young. ( Supplied: Shooters, Fishers and Farmers Party )

The Nationals quickly rejected the allegation.

"The claims are false," said a spokesman in a statement to the ABC.

"The claims were investigated by electoral staff as they should be. No action was taken.

"The volunteer was only handing out authorised campaign material."

But the NSW Electoral Commission's Richard Carroll later gave a different account of the incident.

"The Cootamundra returning officer received a call alleging that unregistered electoral material was being distributed at a polling place in Young," Mr Carroll said in a statement.

"The polling place manager spoke to two individuals who were handing out the material.

"Upon being advised by the polling place manager that this material was unregistered, these individuals indicated that they would cease handing it out."

The Electoral Commission said its inspectors "spoke to the people concerned and were advised that they had ceased handing out the material upon learning it was unregistered."

The matter is now subject to a compliance review by the Electoral Commission.