A Labor candidate for the federal election has apologised for sharing a rape joke online.

Luke Creasey, who is running for the seat of Melbourne, is also in strife for sharing pornographic material.

"It’s been brought to my attention that some posts I shared on social media a number of years ago have been circulated," Mr Creasey told AAP today.

Labor's candidate for Melbourne, Luke Creasey (left) and Opposition Leader Bill Shorten (right) during a visit to the Royal Children's Hospital in Melbourne. (AAP)

"They were stupid, immature and in no way reflect the views I hold today. I apologise for these posts which have been removed."

Mr Creasey is the latest in a long line of candidates to come under fire for lewd posts to social media.

The seat of Melbourne is held by the Greens' Adam Bandt.