The Speaker of the Australian parliament has resigned after text messages revealed he had used sexist and vulgar language in an exchange with a former staffer, who is suing him for sexual harassment.

Peter Slipper's resignation followed a heated debate in parliament during which the prime minister, Julia Gillard, and the conservative opposition leader, Tony Abbott, traded insults over the use of misogynistic language in politics.

The offending text messages, revealed as part of court proceedings against Slipper, described female genitalia as looking like "a mussel removed from its shell".

"Look at a bottle of mussel meat! Salty Cunts in brine!" he continued in his text message to former staffer James Ashby. "Been to thw (sic) fish shop yet to buy the bottle of shell less mussells (sic)?"

At question time Abbott, leader of the Liberal party, called for Slipper to be sacked. The Speaker stood aside earlier this year, pending the outcome of the legal proceedings, but retained many of the perks of the office.

"This Speaker's actions are this prime minister's responsibility and this Speaker's standards perforce are this prime minister's standards, unless she has the responsibility and the decency to remove this Speaker from this high office," Abbott told the house.

Gillard hit back, saying she "would not be lectured about sexism and misogyny by this man [Abbott]. Not now, not ever."

"The leader of the opposition says that people who hold sexist views and are misogynists are not appropriate for high office," she continued. "Well, I hope the leader of the opposition is writing out his resignation because if he wants to know what misogyny looks like in modern Australia, he needs a mirror."

The prime minister said she had been offended when Abbott had stood in front of placards at political rallies that described her as a "witch" and another male politician's "bitch".

"I was offended too by the sexism, by the misogyny, of the leader of the opposition catcalling across this table … [such as] 'If the prime minister wants to, politically speaking, make an honest woman of herself' – something that would never have been said to any man sitting in this chair.

"I was offended by those things. Misogyny. Sexism. Every day from the leader of the opposition," she said.

The anger in parliament follows a fortnight of debate about the tone of politics in Australia after the country's best known radio talkshow host said Gillard's recently deceased father had "died of shame" because his daughter stood in parliament and told lies.

Alan Jones's comments during a Sydney University Liberal Club dinner triggered outrage. A number of companies which sponsored or advertised on his show withdrew their support. |On Monday, the station suspended all advertising on his show.

In calling for Slipper to be sacked, Abbott echoed Jones's remarks, saying Gillard should be ashamed of herself. "Every day the prime minister stands in this parliament to defend this speaker will be another day of shame for … a government that should already have died of shame," said the opposition leader.

A furious Gillard hit back again, saying: "The government is not dying of shame. My father did not die of shame. What the leader of the opposition should be ashamed of is his performance in this parliament and the sexism he brings with it."

Slipper's resignation weakens Gillard's minority government, which is reliant on independents to keep it in office. The elevation of a Labor MP to the Speaker's chair means the party loses one more vote in parliament. An election must be held by October 2013.