The Independent deputy stepped down in shame as details of the sordid Facebook emails from his Dail laptop were exposed.

One of the messages asked girls if they wanted to be spanked, while another contained a request for underwear to be sent in the post.

Former Labour man Nulty – who was elected after the death of Brian Lenihan in 2011 – apologised in a statement.

He said: “It was never my intention to upset anyone in this way but it was totally wrong.”

Fianna Fail leader Micheal Martin said Mr Nulty did the right thing by resigning.

He said on Sunday: “Obviously it’s extremely difficult for everybody involved here, particularly for the young girl and her family, who received the inappropriate messages.

“And indeed for Patrick Nulty himself.

“I think he has done the right thing in resigning.”

Gardai will examine the messages before deciding what course of action to take.

Mr Nulty, who was elected after the death of Brian Lenihan in 2011, was forced to throw in the towel as gardai are expected to launch an inquiry into the disturbing revelations.

Dublin West TD Patrick Nulty

In a statement, Mr Nulty insisted he had only sent the messages while under the influence of alchohol.

The statement read: “I sent inappropriate messages via Facebook.

“This included inadvertently sending one to a 17 year old woman.

“To the best of my knowledge I have never met this woman and the message was sent while under the influence of alcohol.

“I apologise wholeheartedly to the woman involved and to her family.

“It was never my intention to upset anyone in this way but it was totally wrong.”

Mr Nulty said the messages were “entirely inappropriate and I take full responsibility for my actions”.

He added: “For this reason I have decided to resign my seat in the Dail.

“I set myself the highest standards personally and politically.

“Unfortunately due to personal mistakes I have not met those standards in this matter and I will take responsibility for that.

“I still believe passionately that Ireland can be a fairer and more just society based on equality and social justice but at the present time I believe to resign is the correct and right course of action.”

Initially Mr Nulty claimed his phone had been hacked when confronted over Facebook messages over the last two years.

Some of them were sent in the early hours of December 29 2013 and others on January 2014.

The messages included ‘have you ever be spanked?’ and ‘did the hubby leather you for not paying that rent’.

He also sent a mail to a mother of one of the girls.

On one occasion when he sent a message he followed up with the words ‘phone hacked please ignore’.

One of the families of the girls he made contact with have made a complaint to gardai.

Eamon Gilmore, Patrick Nulty and Joan Burton

Mr Nulty was elected as a Labour TD but quit weeks later after voting against the Budget.

He formally quit the party in June last year and had recently joined the Independent Alliance.

The disgraced deputy said he wanted to thank all those who stood by him and he appealed for privacy.

Mr Nulty said: “In politics people very often do not take responsibility for their actions. I hope I am doing that.

“I would further like to apologise to my constituents in Dublin West for my mistake.

“I hope they will understand my reasons for resigning and accept my apology.

“I hope that as I have taken decisive and direct action on this matter my privacy will now be respected in what has been a very difficult decision for me personally.”

Gardai are expected to examine the messages sent by Mr Nulty before deciding what course of action to take.

His resignation will mean there will have to be a by-election in the area.

Fianna Fail’s David McGuinness looks set to win the seat after coming a close second to Mr Nulty in 2011.