Australian Deputy Prime Minister Barnaby Joyce has announced his resignation amid a scandal over an extra-marital affair he had with one of his staffers.

Joyce, who became deputy prime minister of Australia two years ago, said the resignation would take effect on Monday and that he would also be stepping down from his role as leader of the right-of-centre National Party of Australia.

The party is a junior partner in Prime Minister Malcolm Turnbull's government, which is headed by his Liberal Party.

"I will continue to fight for the people in the weatherboard and iron, for the people on the peripheral and the small regional towns," Joyce wrote on Twitter.

"I used my experience of these towns and my goal in life will always be to try to make their lives better."

The announcement also comes after it was revealed that a sexual harassment complaint had been filed against him to his party. He has denied any wrongdoing.

On Monday morning I will step down as the Leader of @The_Nationals and Deputy Prime Minister of Australia. I would like to thank everyone for offering their support to me, especially the people of New England. — Barnaby Joyce (@Barnaby_Joyce) February 23, 2018

Turnbull and Joyce have become embroiled in a public spat since reports of the latter's affair with staffer Vikki Campion became public.

Australia's ministerial code requires members of the government to declare relationships with members of staff.

In response to the scandal, the prime minister announced a ban on government ministers having sex with their employees and later called Joyce's actions a "shocking error of judgement".

Joyce hit back, calling Turnbull "inept" and implied that he had not informed him of the decision to resign when asked if had done so by reporters.

The outgoing deputy prime minister said he had only given notice of his resignation to Senator Mathias Cormann, who is filling in as acting prime minister while Turnbull is on a visit to the US.

Joyce's announcement of his resignation is the latest blow to Turnbull's government and comes after a year of political instability brought about by a constitutional crisis surrounding legislators with dual nationality.

In October last year, the High Court ruled that dual nationals could not hold elected office, forcing several members of the governing coalition who unknowingly held New Zealander nationality to stand down, including Joyce.

Joyce was re-elected in a by-election for his constituency seat after stepping down and renouncing his citizenship of New Zealand.