The Taoiseach, Mr Ahern, may have solved more than one problem by securing the presidency of the European Commission for the Portuguese Prime Minister, Mr Jose Manuel Durão Barroso, writes Arthur Beesley.
In the first instance, Mr Barroso's appointment at a summit tonight in Brussels removes the possibility, however slim it may have been, that Mr Ahern himself would have ended up in the post.
Despite repeated hints of his own suitability for the job, Mr Ahern never wanted to go to Brussels as a compromise candidate.
The Taoiseach's resolution of the deadlock over the job also closes the final loose end of an Irish EU presidency, which formally ends tomorrow.
To have failed on that front, after a hard-won agreement on the EU constitutional treaty, would have left an unseemly blot on what is widely seen as a successful presidency.
Now the Government is hoping for a major dividend in the form of a powerful portfolio in the EU Commission.
By way of proof, it was indicated last night that Mr Ahern might nominate Ireland's appointee in the next fortnight to establish a clear presence in the field up to six weeks before the final deadline for nominations.
With France and Germany now gunning for control of the big economic commissions, several sources in Dublin said the agriculture portfolio may yet fall to Ireland.
The Minister for Agriculture, Mr Walsh, would be the only man in the race in this scenario.
Seen as likely to be retired from the Cabinet in the September reshuffle, he has indicated a willingness to move to Brussels. While Mr Walsh's long background in EU agricultural politics and commitment to CAP reform leads some to suggest he is a strong contender, his Dutch counterpart, Ms Cees Veerman, is acknowledged in Dublin to be a strong rival for the job.
Sources in Fianna Fáil said the certainty of securing the agriculture portfolio would override concern that the party might not win Mr Walsh's seat in Cork South-West in a by-election in the three-seat constituency.
Mr Walsh will not be a candidate if agriculture is not available. The field would widen to include the Minister for Arts, Sport and Tourism, Mr O'Donoghue, but also the Minister for Transport, Mr Brennan, and the Minister for Finance, Mr McCreevy.
Of these three, Mr O'Donoghue would be the most likely candidate. He remains in favour with Mr Ahern, despite Fianna Fáil's poor showing in the European election campaign which he directed.
By contrast, Mr McCreevy has gone out of his way to say that he does not want to move to Brussels. Such a move is considered unlikely, even though his removal from Finance would enable the transfer of Mr Brian Cowen into a Department which is seen as a "finishing school" for Fianna Fáil leaders in waiting.
With the transport unions set against Mr Brennan's reform agenda, he may yet get the post, if only to remove a headache for Mr Ahern. However, that is seen by some as the least likely scenario.
Mr Ahern, who clearly has the ear of Mr Barroso, will be weighing these options in the next fortnight.