NSW Premier Gladys Berejiklian has survived a no confidence vote brought on by Opposition Leader Jodi McKay, who accused her of turning a blind eye to corruption.
The no-confidence motion was defeated 47-38 in the lower house on Wednesday while the same motion was also defeated in the upper house, after a tied vote forced chair John Ajaka MLC to weigh in and cast the deciding negative vote.
"Decisions should not be taken except by majority, meaning that the chair should not be the reason a motion passes," Mr Ajaka said, explaining his vote.
The narrow escape came amid a rowdy day in the bear pit after Ms Berejikilian spent a third day battling to keep her job as her former boyfriend Daryl Maguire faced a grilling at the Independent Commission Against Corruption.
Watch: Gladys Berejiklian admits to a "close personal relationship" with former MP Daryl Maguire. Post continues below.
Ms McKay told parliament that while Ms Berejiklian was entitled to have a private life, her "close personal relationship" with the disgraced former Wagga Wagga MP was a "damning indictment on her ability to run a government".
"This is a premier who failed to act ... and turned a blind eye to wrongdoing," she told the NSW lower house on Wednesday.
"If we accept Gladys Berejiklian as premier we are saying the utterly unacceptable is OK. This motion is ... about the integrity of public office in NSW, the integrity of the office of the premier.
"If the premier stays, your government is forever diminished."
In response, NSW Treasurer Dominic Perrottet said Ms Berejiklian had demonstrated "complete honesty and integrity".
"There is no better leader in this country than Gladys Berejiklian," he said.
The premier continued to insist she had done nothing wrong.
Phone intercepts played at ICAC on Monday recounted numerous occasions in 2017 and 2018 in which Mr Maguire - who resigned from NSW parliament in 2018 in connection to a separate ICAC inquiry - discussed his business dealings with Ms Berejiklian.