Former NSW deputy Nationals leader Niall Blair has retired from politics after accepting a role as a university professor.
Mr Blair, who was elected as a member of the upper house in 2011, handed in his resignation to NSW Governor-General Margaret Beazley on Wednesday.
After the NSW election in March Mr Blair stepped back from his ministerial roles, including the trade and primary industries portfolios.
He said at the time the hostility directed towards him after millions of fish died in NSW's inland rivers that summer had significantly impacted his family life.
Charles Sturt University earlier in October announced Mr Blair would take on the newly-created role of professor of food sustainability after he stepped down from parliament.
He will assume the role on Monday.
In his valedictory speech on Tuesday, Mr Blair said the most important thing he learned as a minister was that "you have got to turn up, even when that is really difficult".
Deputy premier John Barilaro last month paid tribute to Mr Blair.
"Niall is a dedicated representative for the people of regional NSW, particularly in the agriculture and water space, and he will be sorely missed," Mr Barilaro said in a statement.
Royal Bathurst Show Society president Sam Farraway was elected to take the vacancy created by Mr Blair's resignation in a joint sitting of parliament on Thursday afternoon.
When announcing the decision in September, Mr Barilaro said Mr Farraway and the NSW Nationals shared the same values.
"I know he will continue to work hard to represent the interests of families, businesses and local community groups in regional NSW," Mr Barilaro said.
Australian Associated Press