A Central Coast chiropractor and former Liberal Party member has narrowly avoided jail for posting racist and offensive messages on the Facebook page of former senator Nova Peris.

Chris Nelson, 64, initially claimed his Facebook profile had been hacked when messages were sent calling Ms Peris a "black c---" and telling her to "f--- off" and "go back to the bush and suck on witchity [sic] grubs".'

However, last month he pleaded guilty in Woy Woy Local Court to one count of using a carriage service to offend.

On Tuesday, he was given an eight-month suspended jail sentence after the court heard he had a "brain snap". He was also placed on a two-year good behaviour bond.