CANBERRA, Australia -- Australia's prime minister and his deputy have criticized each other in an open and hostile rift over politically damaging revelations that the deputy is expecting a baby with a former press secretary.

Prime Minister Malcolm Turnbull on Thursday accused Deputy Prime Minister Barnaby Joyce of making a "shocking error of judgment" by having an office affair that 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," Turnbull said.

Get Breaking News Delivered to Your Inbox

Joyce hit back on Friday, describing Turnbull's remarks as "inept" and "completely unnecessary."

"All that's going to do is basically pull the scab off for everybody to have a look at," Joyce told reporters.

Since the scandal became public last week, Turnbull had avoided commenting for the sake of Joyce's estranged wife and four daughters. But Turnbull responded on Thursday by banning his ministers from having sex with staff.

The Prime Minister, Malcolm Turnbull listens to a question about Barnaby Joyce during Question Time on February 14, 2018 in Canberra, Australia. Getty

Turnbull last week talked down the prospect of a U.S. House of Representatives-style ban on lawmakers having sex with staff, arguing that elected officials had a right to consensual sexual relationships.

Critics argue that the Australian prohibition has opened ministers' private lives to media scrutiny. The Australian political press has traditionally steered clear of politicians' sex lives unless there is a legitimate public interest.

Joyce said the ban "will create immense fodder for the good people in the media and it will obviously reverberate across all political parties." But he said ministers in his Nationals party, the junior partner in the coalition government, would abide by the new rule.

Later Friday, Turnbull said he stood by his criticism and after watching a video of Joyce's press conference, added: "I understand it is a very stressful time."

In a move interpreted by some as punishing his deputy, Turnbull announced Thursday that Joyce would not become acting prime minister next week when Turnbull travels to the United States. He explained on Friday, before Joyce's angry news conference, that his deputy "has taken some leave and he is considering his position."

"Barnaby Joyce has my confidence as deputy prime minister," Turnbull said.

But Joyce said Friday he had no intention of quitting.

"This was a personal issue, a personal issue that's been dragged into the public arena and I don't believe people should be resigning in any job over personal issues," Joyce said.

Many agree with Joyce that 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 Joyce's office and the rent-free apartment owned by a wealthy political donor where Joyce and Campion now live.

Joyce is deputy prime minister because of a longstanding agreement between Turnbull's conservative Liberal Party and the Nationals. Whoever the Nationals choose to lead them also becomes the nation's deputy leader.

Joyce warned that any pressure on the Nationals to dump him "locks people in as they lock-in behind the leader."

Turnbull later replied: "I have not sought in any way to influence the deliberations of the National Party," referring to the party's name before it was changed to Nationals in 2003.

The Nationals held a crisis meeting on Wednesday over whether Joyce should continue as their leader.

Nationals President Larry Anthony, the party's most senior bureaucrat and a former legislator, said the meeting resolved to give Joyce more time to ride out his controversies.

The strain in the coalition comes as the government trails the center-left opposition Labor Party in opinion polls for months.

Opposition leader Bill Shorten said on Friday: "The way these two men are behaving, neither is fit for the high offices they currently hold."

"Yesterday, Mr. Turnbull declared war on Mr. Joyce. Today, Mr. Joyce has declared war on Mr. Turnbull. Australians have every reason to be angry and frustrated when the two most senior Australian leaders are not focused on anything other than their own jobs," Shorten told reporters.