Updated

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

Prime Minister Malcolm Turnbull on Thursday 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.

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

Turnbull said Joyce will not serve as acting prime minister when Turnbull visits the United States next week.