Australia’s prime minister has banned his ministers from having sex with staff as his deputy battled for political survival over revelations that he is expecting a baby with a former press secretary.

Prime minister Malcolm Turnbull accused Barnaby Joyce of making a “shocking error of judgment” by having an office affair which had hurt his wife, his four daughters and his new partner, who is due to give birth in April.

“He has set off a world of woe for those women and appalled all of us,” Mr Turnbull told reporters.

“Ministers, regardless of whether they are married or single, must not engage in sexual relations with their staff,” he said, stating a new rule that his cabinet must now adhere to.

LIVE now making a statement from Parliament House https://t.co/JGgQXBtFAn — Malcolm Turnbull (@TurnbullMalcolm) February 15, 2018

Since news of the impending birth broke last week, Mr Turnbull has supported Mr Joyce and declined to comment on his personal circumstances out of respect for his estranged wife of 24 years and children.

Last week, the PM talked down the prospect of Australia following the US House of Representatives by banning legislators from having sex with staff, saying they were entitled to private lives.

But with the opposition questioning whether Mr Joyce had breached the government’s guidelines for ministerial conduct, Mr Turnbull announced on Thursday that his deputy will not serve as acting prime minister when Mr Turnbull travels to the US next week.

Motions to have Mr Joyce fired were defeated in the Senate and House of Representatives on Thursday.

Mr Turnbull had said as recently as Wednesday that Mr Joyce would act as prime minister, which is the usual role of his deputy, but the PM said the government would be led in his absence by its Senate leader, Mathias Cormann, because Mr Joyce was taking leave for a week.

He has set off a world of woe for those women and appalled all of usMalcolm Turnbull

Mr Joyce has said his marriage breakdown and his current relationship with Vikki Campion are private matters.

But questions have been raised about her employment in two government jobs after working in Mr Joyce’s office and the rent-free apartment owned by a wealthy political donor where Mr Joyce and Ms Campion now live.

“My personal circumstances have been up hill, down dale in this last week. I accept that and that is the price of a political life,” Mr Joyce said in his first speech in parliament discussing the relationship since the reports surfaced.

His National party, the junior coalition partner, held a crisis meeting on Wednesday over whether he should continue as its leader.

Party president Larry Anthony said it had resolved to give him more time to ride out his controversies.

“It’s been an extraordinarily difficult time for the … party and clearly for Barnaby Joyce and his family and for the government,” Mr Anthony told reporters.

“It’s important people think very carefully about making any significant decisions. You are never wise to make decisions in the heat of the moment. Barnaby should be given time.”

PA Media