A jailed MP convicted of sex offences has resigned from NSW parliament, ahead of a motion to have him expelled.
An hour before colleagues were set to vote to expel him on Friday, Kiama MP Gareth Ward resigned his seat, amid widespread calls to remove him from the house.
The former families minister, 44, had resisted calls to resign as he awaits sentencing for sexually assaulting a political staffer after a parliamentary event in 2015.
He was also found to have sexually abused an 18-year-old man at his South Coast home in 2013.

Gareth Ward has filed a notice of intention to appeal against his conviction. Source: AAP / Bianca De Marchi
Ward has filed a notice of intention to appeal against his conviction.
Speaker Greg Piper announced Ward wrote to him on Friday morning to resign his seat, triggering a by-election at a soon-to-be-announced date.
Ward had launched a legal bid to cling to his seat, resulting in a vote to expel him from parliament being delayed.
But an injunction was dismissed by the NSW Court of Appeal on Thursday, paving the way for a parliamentary debate and vote on whether Ward should be removed.
Chief Justice Andrew Bell said: "The fact that Mr Ward has filed a notice of intention to appeal does not affect the power of the assembly to expel him."

The vote on Friday was expected to result in the expulsion of the Kiama MP. Source: AAP / Dean Lewis
Following the decision, the leader of the lower house, Ron Hoenig, gave notice of a motion to expel Ward, "who is in custody, and unable to be present for the debate on the motion".
He withdrew the motion after the resignation.
"It is regretful that this house has been put through this difficulty but better late than never," Hoenig said on Friday.
"[He has resigned] knowing full well what the almost unanimous decision of the house was going to be had he not tendered his resignation."
Mark Speakman supported expulsion move
Opposition leader Mark Speakman had repeatedly called on his former party colleague to resign from parliament, and pledged support for any move to expel him.
Four MPs have been expelled from NSW parliament — the last in 1969, under the "unworthy conduct" power.
Ward won the Kiama seat as a Liberal in 2011, retaining it at multiple elections before leaving the party after charges were laid.
He won the seat again as an independent at the 2023 state election despite being suspended from parliament.
If you or someone you know is impacted by sexual assault, call 1800RESPECT on 1800 737 732, text 0458 737 732, or visit 1800RESPECT.org.au. In an emergency, call 000.