MELBOURNE, Australia — Barnaby Joyce, Australia’s deputy prime minister, said on Friday that he would resign his post after a series of damaging revelations, including an extramarital affair, led to weeks of searing headlines and a change in the rules for how politicians must conduct themselves.

“I’ve acknowledged that in many areas, I’m rough around the edges,” Mr. Joyce said at a news conference in the city of Armidale. “I never tried to be anything else.”

Mr. Joyce, a populist from rural Australia and a crucial member of Parliament’s governing coalition, had previously admitted to an affair with a former staff member, who is now pregnant. The Australian news media was reluctant to report on the relationship with the woman, Vikki Campion, until it was discovered that the couple were living rent-free in an apartment donated by a supporter.

Later, two women came forward to accuse Mr. Joyce of sexual harassment and misconduct.

Friday’s news conference came less than 24 hours after the second of those women came forward with allegations that Mr. Joyce had harassed her.