Update 9.15pm

The Nationals have chosen Barnaby Joyce as their new leader, replacing Warren Truss and elected senator Fiona Nash as their first federal woman deputy leader. Joyce, who automatically becomes deputy prime minister, was unopposed, while Nash defeated six other candidates.

Nash, from NSW, who is Minister for Rural Health in the outer ministry, will go into cabinet in the coming reshuffle and can expect a more senior portfolio.

Earlier story:

The Nationals are set to elect Barnaby Joyce unopposed as their leader on Thursday night, which will make him deputy prime minister and clear the way for Malcolm Turnbull to reshuffle his ministry in the next few days.

Nationals leader Warren Truss on Thursday brought forward his date for quitting the leadership to prevent instability in his party and facilitate the reshuffle.

He had intended to announce he would step down on March 17, but colleagues did not want the uncertainty to run on and he changed his timetable. His original plan would also have put off the vote for his replacement and so the reshuffle, which has to wait on the Nationals having a new leader.

NSW MP Michael McCormack had been touting for the Nationals leadership but pulled out on Thursday when the numbers for Joyce were clearly strong, despite some MPs being in an “anybody-but-Barnaby camp”. There is expected to be a wide field for deputy leader.

The main outstanding issue now to be dealt with before the reshuffle is the future of Human Services Minister Stuart Robert, whose conduct while in China on a private visit is being examined by the secretary of the prime minister’s department, Martin Parkinson, to determine whether it breached the ministerial code of conduct.

A decision on Robert’s future appears imminent.

Trade Minister Andrew Robb has also announced he will leave parliament at the election. He will stay on in his portfolio for a time but has indicated he will step down from the frontbench in the next few months. Some sources said he would be going to the backbench relatively soon.

Getting the reshuffle done is becoming urgent, given that significant changes will be made and time is short in an election year. Government sources expected the changes to be announced over the weekend, with the swearing in early next week.

Immigration Minister Peter Dutton, speaking on radio, made it clear he expected to stay in his portfolio. “I think continuity in this portfolio is important and that’s been the prime minister’s advice to me as well,” he said.

Truss – who will remain in parliament until the election – told the House of Representatives that when he became leader after the 2007 election defeat “nobody wanted the job, including me”.

“My objective … when I became leader, somewhat reluctantly, was to rebuild a party that was at that stage at a pretty low ebb,” he said. “I am sure that the party will be in good and strong hands in the years ahead.”

Truss said he had come from a small farming district and went to a very small state school.

“And I had the privilege now to become deputy prime minister of our country. I wonder whether I’ll be the last person with a limited education who comes from one of the poorest electorates in the country to become deputy prime minister. I hope not, because I think we do need amongst the leadership of our country, a breadth of experience and skills.”

Paying tribute to Truss, Turnbull said: “He understands the importance of the National Party’s distinct identity, but also the reality that we are so much stronger when we are working closely together”.