Michael Daley has been elected as the NSW Labor leader to take the party to the March 2019 election after Luke Foley's resignation.
The Member for Maroubra received 33 of 45 votes in a caucus meeting on Saturday afternoon, while Chris Minns received the other 12.
The switch left Mr Daley's deputy Labor leader job open, with the only nominee Penny Sharpe picked as his replacement.
Mr Foley resigned after ABC journalist Ashleigh Raper issued a statement alleging he put his hand through the back of her dress and groped her at a 2016 Christmas party.
He has denied the allegation but said he won't seek re-election to parliament.
Deputy leader Michael Daley on Friday emerged as the frontrunner to replace Mr Foley but within hours 39-year-old Chris Minns, Labor Member for Kogarah, also threw his hat in the ring.
Both men distanced themselves from Mr Foley, who they suggested should leave the party altogether.