Michael Johnson claimed victory for the National Party in the closely fought seat of Upper Hunter late on Sunday afternoon.
While Labor's Melanie Dagg and Mr Johnsen remained neck and neck on Saturday night the incumbent member pulled ahead throughout Sunday.
With 80 per cent of the vote counted, Labor had secured 47.8 per cent of the two-party preferred vote and Mr Johnsen 52.2 per cent.
The seat, previously held with a margin of 2.2 per cent, had a 0.1 per cent swing away from Mr Johnsen.
Mr Johnsen, who spent Sunday afternoon at Muswellbrook races, described the victory as a "long, tough road".
"I have basically been campaigning for the past four years," he said.
It's been a long, tough road. I have basically been campaigning for the past four years.Michael Johnsen
"I am extremely humbled and am honoured to represent the wonderful people of our Upper Hunter communities in the NSW Parliament."
"Thank you to all those that have expressed support, especially my supporters, friends and family that worked for days on end to ensure victory."
"I congratulate Melanie on her efforts and wish her and her family well for the future."
Ms Dagg took over the Labor candidacy in January after former candidate Martin Rush withdrew when an anonymous assault allegation was referred to police.
Mr Rush denied the allegation, and the complaint was dismissed by Labor's candidate review committee.
The party spared no expense attempting to win the seat with several major roads and health commitments announced during the campaign.
Ms Dagg, who is also Cessnock deputy mayor, said she was proud of what her team had achieved during the campaign.
"I have called Michael Johnsen this evening to congratulate him on his winning the seat of Upper Hunter," Ms Dagg said in a statement on Sunday night.
"Country Labor is proud of the fact that we ran a positive campaign focused on improving our hospitals, schools and infrastructure, protecting our water, and standing up for the pay and working conditions of our mining workers."
"Our commitment to deliver for the people of the Upper Hunter continues, and I will be working hard every day to hold this government to account."