Three Irish parties are set to govern in coalition with a rotating prime minister after agreeing a draft deal on Monday, shutting Sinn Fein out of office despite their surge at the polls.

Four months after a landmark election, the largest party in parliament, Fianna Fail, said it had "signed off on the draft programme for government" with Fine Gael and the Green Party.

Earlier, Prime Minister Leo Varadkar of Fine Gael -- acting in a caretaker role since his party was routed at the polls -- said there would be a rotating prime minister at dates that had been agreed upon.

Fianna Fail leader Micheal Martin, who leads a 38-seat bloc in a 160-seat parliament, would become the first premier until December 2022, when Varadkar would take over, RTE said.

"We're going to have to learn to work with each other, we're going to have to learn to trust each other, but I know that's possible," Varadkar said.

Sinn Fein, the former fringe left-wing republican party which won the second largest number of votes at the election, condemned the agreement.

Sinn Fein, which had been seeking to break the traditional dominance of centre-right Fianna Fail and Fine Gael, was excluded from the talks.

Fianna Fail leader Micheal Martin will be the first prime minister under the new arrangement
Fianna Fail leader Micheal Martin will be the first prime minister under the new arrangement AFP / PAUL FAITH

Leader Mary Lou McDonald said the two main parties were only interested in "protecting the status quo".

"A government led by Fine Gael and Fianna Fail together does not represent the change that people voted for in February," she said.

"Leo Varadkar and Micheal Martin set about excluding Sinn Fein from government talks and, in doing so, they excluded the demand for change that came from the people."

The deal, which involves 35 Fine Gael and 12 Green lawmakers with those from Fianna Fail, still requires approval from rank-and-file party members.

If granted, the new government could be installed by the end of June, Varadkar said.

The coalition would represent a milestone in Irish politics as Fine Gael and Fianna Fail -- rivals since the Republic's civil war -- would govern together for the first time.

Sinn Fein would become the largest party of opposition.

It came first in the popular vote on February 8 with more than 24 percent of first preference ballots, and became the second biggest group in parliament with 37 seats.

But its past associations with Irish Republican Army paramilitaries hampered attempts to broker a deal with other parties to reach the 80-seat threshold needed to take office.