CANBERRA, Australia -- Australia's beleaguered deputy prime minister resigned from the Cabinet on Friday over allegations that he sexually harassed a woman, but said he would not resign from Parliament. By staying in Parliament, Barnaby Joyce ensures that Prime Minister Malcolm Turnbull's single-seat majority in the House of Representatives is maintained.

The allegation of sexual harassment adds to scrutiny Joyce has faced since news broke earlier this month that he and his former media secretary Vikki Campion are expecting a baby in April.

Questions have been raised about her employment in two government jobs after working in Joyce's office last year and the rent-free apartment owned by a wealthy political donor where Joyce and Campion now live.

Joyce said his Nationals party, the junior partner in the ruling coalition, will pick a new leader on Monday.

Get Breaking News Delivered to Your Inbox

"It's incredibly important that there be a circuit-breaker, not just for the Parliament, but more importantly, a circuit-breaker for Vikki, for my unborn child, my daughters and for Nat," he told reporters, referring to his estranged wife of 24 years and mother of his four daughters, Natalie Joyce.

Whoever Nationals lawmakers choose as their new leader on Monday will become deputy prime minister.

Australia's Deputy Prime Minister Barnaby Joyce (R) looks at Prime Minister Malcolm Turnbull (L) addressing a press conference in Sydney, in a July 5, 2016 file photo. Getty

Joyce, a political maverick who has led his party since elections in mid-2016, said he would not accept any ministerial portfolio. As well as deputy prime minister, he was minister for infrastructure and transport.

He said media reports that an unidentified woman had made a sexual harassment complaint against him was the "straw that breaks the camel's back." He denied the allegations, and said he requested they be referred to police for investigation.

He has also denied a media report that he pinched a woman's buttock while drunk in a Canberra pub several years ago.

Nationals President Larry Anthony, the party's senior bureaucrat, said in a statement: "The party will greet this news with a heavy heart but we understand and respect his decision to stand down as leader."

Turnbull said in a statement the coalition government "partnership is undiminished" by the Nationals' leadership change.

Joyce and Turnbull have openly attacked each other since news of the deputy prime minister's office affair broke.

Turnbull accused his deputy of making a "shocking error of judgment" by having an office affair. Joyce described his leader's remarks as "inept" and "completely unnecessary."

In a move interpreted by some as punishing his deputy for a politically damaging scandal, Turnbull did not appoint Joyce to the role of acting prime minister while Turnbull visits Washington this week. Turnbull explained Joyce was taking leave to consider his future.