LONDON — Four months after an election that brought down its government but settled little else, Ireland’s two main parties struck an agreement Monday to govern together for the first time, opening an unpredictable chapter in Irish politics as the country faces the economic fallout from the coronavirus pandemic.

Leaders of the parties, Fianna Fail and Fine Gael, signed off on a draft agenda for a coalition government that will include a third party, the Greens, but not Sinn Fein, a party the coalition partners were eager keep out of the government. The two parties will rotate the prime minister’s job, with the Fianna Fail leader, Micheal Martin, initially replacing the current prime minister, Leo Varadkar of Fine Gael.

The deal, after several weeks of tortuous negotiations, attests to the diminished stature of the parties and the fractured state of Irish politics. With shared roots in Ireland’s struggle for independence and similar center-right politics, Fianna Fail or Fine Gael has led every Irish government since 1927, sometimes supporting each other in Parliament but never governing in a formal coalition.

In February, voters delivered a rebuke to both parties, leaving the governing Fine Gael and the opposition Fianna Fail essentially deadlocked in Parliament with the Irish nationalist party, Sinn Fein. Faced with the unpalatable prospect of going into a coalition with Sinn Fein, the two sought refuge in each other.

“It’s a dramatic breach from the past,” said Fintan O’Toole, a columnist at the Irish Times. “Irish politics has always been a binary choice between Fianna Fail and Fine Gael. But the paradox of what’s happening is that it’s vastly overdue. The very fact it’s so overdue tells you how powerful the system was.”

The new government will face vastly greater challenges than either party expected before the election. In a document setting out its agenda, the leaders agreed to a costly stimulus program that will run through 2022 to “repair the damage that has been inflicted by the pandemic.”

Image
Credit…Henry Nicholls/Reuters

As a condition of joining the coalition, the Green Party extracted a pledge to reduce Ireland’s greenhouse gas emissions by 7 percent a year. Party leaders must win the support of two-thirds of their members, which could still unravel the deal.

The rise of Sinn Fein has scrambled the calculations for all the parties. While they do not want to form a coalition with it — in part because of its historical links to the Irish Republican Army — they also worry that leaving it alone in the opposition will enable it to pick off even more voters, at their expense.

Sinn Fein, analysts said, would benefit by staying in the opposition since it could exploit the difficult decisions that the new government will have to make. Mary Lou McDonald, the party’s leader, said the coalition would “protect the status quo” and do little to alleviate Ireland’s housing shortage or public health crisis.

“There’s such a reluctance to govern,” said Diarmaid Ferriter, professor of modern Irish history at University College Dublin. “Fine Gael and Fianna Fail have never done this before, so they don’t know what it will do to their core support.”

Still, Professor Ferriter said the coalition would signify a seminal transition in Irish politics, from the civil war politics that divided the country for nearly a century to a more traditional left-right split, as Sinn Fein has adopted many left-wing positions. With multiple parties attracting a comparable share of the vote, Ireland now looks more like continental Europe than Britain, where the Conservatives and Labour still dominate in Parliament.

For all their historic significance, the coalition talks were overshadowed by the pandemic. Mr. Varadkar, 41, won praise for his sure-footed handling of the crisis. A retired physician, he reactivated his medical license and fielded calls from people who believed they had contracted the virus. Ireland has reported 1,700 virus-related deaths, about half the per capita rate as in neighboring Britain.

Mr. Varadkar’s performance revived his fortunes after a lackluster campaign, in which voters blamed him for Ireland’s housing crunch and grew disenchanted with his aloof manner.

The political arithmetic of the election results meant he was never likely to lead a new government: Fine Gael won 35 seats, to Sinn Fein’s 37 and Fianna Fail’s 38.

Image

Credit…Phil Noble/Reuters

Yet under the deal, Mr. Varadkar would return to the prime minister’s post in December 2022, a remarkable turnabout for a politician who was all but written off in February. Mr. Martin, 59, is a fixture in Irish politics, having served in multiple cabinet posts in the last Fianna Fail government and as opposition leader since 2011.

How well the two parties will work together is still an open question. Despite their ideological overlap, they have deep-rooted social and cultural differences that date to their founding in the aftermath of the Irish civil war. Fianna Fail was started by those who opposed the Anglo-Irish treaty that ended the war; Fine Gael grew out of those who supported it.

Mr. O’Toole referred to it as the “masochism of small differences” and noted that this history means very little to younger Irish voters, who look at the policies of the parties and say, “you guys are identical.”

The bigger question is whether such a government can rebuild Ireland’s economy. The pandemic has blown a hole in the state budget and swollen the ranks of the jobless. There will be little money for cherished projects.

“What happens at the end of this four or five-year period?” said Theresa Reidy, a political scientist at University College Cork. The two parties, she said, could “emerge in an even more diminished state.”

Anna Joyce contributed reporting from Dublin