Australia’s parliamentary Speaker Peter Slipper has resigned after text messages showed he had used sexist and vulgar language in an exchange with a gay former staffer, who is suing him for sexual harassment.

According to the Guardian, the offending text messages, revealed as part of court proceedings against Mr 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)?”

Mr Slipper, who is married, earlier apologised for the content of the text messages. He also denies the charges of sexual harassment.

His resignation followed a heated debate between Prime Minister Julia Gillard and opposition leader Tony Abbot on Tuesday.

Mr Slipper had been absent from parliament since April and stood aside amid claims of sexually harassing Mr Ashby with sexually explicit text messages and also over allegations of travel fraud.

It has been claimed that Mr Slipper had requested massages from Mr Ashby and asked him for graphic details about his sex life.

The travel fraud claims were later withdrawn; however, the sexual harassment case is ongoing.