Jim Gavin has been selected as the Fianna Fáil candidate to contest the Presidential election.
The former Dublin football manager defeated MEP Billy Kelleher on a margin of 41 votes to 29 cast by the party's TDs and senators.
Fianna Fáil senator Mark Daly from Kenmare didn't have a vote because he is Cathaoirleach of the Seanad.
Kerry Fianna Fáil councillor Tommy Cahill expects his party will issue a diktat to councillors not to support or facilitate potential independent candidates for the Presidential election.
Both Jim Gavin and Billy Kelleher gave ten-minute presentations before the secret ballot vote.
Gavin managed to carry his declared candidates and more to win the vote, with 41 members of the parliamentary party backing him
But the contest was closer than expected - a margin of 59 per cent to 41.
Most observers said anything above 25 votes for Billy Kelleher would be something of a headache for Micheál Martin, who put a lot of political capital into Jim Gavin
But he has won - and is the third name confirmed for October's vote alongside Catherine Connolly and Heather Humphreys.