Australian Prime Minister has banned sex between ministers and staff members. [Representational Image]Reuters

When Deputy Prime Minister of Australia made 'a shocking error of judgement' by having an extramarital affair with his former press secretary thus leaving her pregnant, Prime Minister Malcolm Turnbull made an announcement imposing a formal ban on sex between ministers and their staff members.

Turnbull made the announcement on Thursday at a press conference in Canberra as he criticised his deputy, Barnaby Joyce, for bringing humiliation upon his wife and four daughters.

"Barnaby made a shocking error of judgement in having an affair with a young woman working in his office. In doing so, he has set off a world of woe for those women and appalled all of us. Our hearts go out to them. It has been a dreadful thing for them to go through in the glare of publicity," the Prime Minister said during the press conference.

Joyce, who is a Catholic married for 24 years with four children, campaigned for 'family values'.

The scandal involving the 50-year-old politician with his former press secretary has led to new rules being imposed to the ministerial code of conduct in Australia. The new ban is said to have been taken from the recent US Congress' approach towards office romances.

"In 2018, it is not acceptable for a minister to have a sexual relationship with somebody who works for them. It is a very bad workplace practice. And everybody knows that no good comes of it," Turnbull said.

He further added during the press conference: "Ministers, regardless of whether they are married or single, must not engage in sexual relations with staff. Doing so will constitute a breach of the standards."

Joyce admitted to the extramarital affair after a front page picture of his pregnant lover was published in the Sydney Daily Telegraph, that left his wife of 24 years and his four daughters devastated.

Twitter, however, is having a ball after the ban on sex between ministers and their staff.