Green Party leader Eamon Ryan has been elected to the Dáil in Dublin Bay South, joining deputy leader Catherine Martin from Dublin Rathdown, to secure two seats for the party.

He was the first TD to be elected in the constituency, ahead by 765 votes of Fine Gael’s Eoghan Murphy, who was also re-elected.

Kate O’Connell of Fine Gael and Fianna Fáil’s Jim O’Callaghan were elected on transfers, with Labour Minister of State Kevin Humphreys losing out.

Ms O’Connell won out over Renua Ireland and former Fine Gael minister of state Lucinda Creighton, but Mr Humphreys stressed that for Labour it was never a battle between himself and Mr Ryan but between himself and Ms O’Connell.

Mr Humphreys said Labour had not been rewarded for bringing in legislation on the X-case or for the marriage-equality referendum and that voters had punished the party harshly. But he was hopeful the party, the oldest in the State, could keep seven seats and gain speaking rights.

The Green Party leader expressed his sympathy to Labour and said the party should not lose hope. The Greens, he said, had been wiped out in the last Dáil but had come back.

Mr Ryan said: “We have an amazing volunteer story. We’re the first party ever to lose all its seats in the Dáil and come back. It’s a story that money isn’t everything and the power of an idea works.”

Asked about a role in government Mr Ryan said all the parties have an obligation to talk to each other about how a government might be formed, “but I think it’s unlikely for us”.

Mr Ryan, a former minister in the Fianna Fáil-led coalition, and Mr Murphy were elected on the seventh count following the elimination of Sinn Féin councillor Chris Andrews.

On Saturday, Mr Murphy said he had “full confidence” in Taoiseach Enda Kenny, while running mate Ms O’Connell said: “The people of Ireland seem to have forgotten that Fianna Fáil left the country high and dry.”

Ms O’Connell said the exit polls were saying people wanted to see Fine Gael in government but they were not giving them the vote. “It’s something we’ll have to reflect on,” she said.

“It’s shameful to see so many good people, Labour and Fine Gael, lose their seats – who put the country before their party allegiances.”

Asked about unseating Ms Creighton, she replied: “I don’t mind whose seat it is. I’ve said that from the get-go.” But she also said it was a “great battle” between herself and Ms Creighton.

“I enjoyed every minute of it. There was no actual physical battle on the ground. I only bumped into Lucinda once or twice.”

She said she just met Ms Creighton as she was leaving the RDS.

“We were very cordial to each other. We had a handshake. Elections are a very tough job, and Lucinda did very well in previous elections. . . so I admire anyone who goes forward.”

Questioned about what went wrong for the party in its poor showing and if the message did not get out properly, Mr Murphy said: “I’m surprised that we didn’t do better given that I think we’ve had a good government for the last five years, coming out of the bailout, stabilising the economy and moving to try and do that for as many people as possible.”

Asked if he saw the options as a choice between a Fine Gael/Fianna Fáil government or a fresh election Mr Murphy said: “I don’t think anyone wants another election anytime too soon.”