The Irish nationalist party SinnFein secured the most votes but not the most seats in a national election on Sunday, which its leader described as a “ballot-box revolution” that deserved to be rewarded with a first ever place in government.

The formation of the next government could take weeks or months as the two long-dominant parties, Fianna Fail and FineGael, told voters during the campaign that they would not govern with Sinn Fein, a left-wing party that was once the political wing of the Irish Republican Army (IRA) guerrilla movement.

WHO ACTUALLY WON?

Sinn Fein won the highest share of the vote with 24.5% of first preference ballots, ahead of Fianna Fail on 22.2% and Prime Minister Leo Varadkar’s Fine Gael on 20.9%. Sinn Fein’s low number of candidates meant, however, that it only captured 37 seats under Ireland’s single transferable vote system, behind Fianna Fail on 38 but ahead for the first time of Fine Gael, which fell to 35.

WHAT HAPPENS NEXT?

Talks on forming a governing alliance will begin among the three main parties and smaller groups including the centre-left Greens, the Social Democrats and Labour. In 2016, it took 10weeks to form a government.

WHAT ARE THE OPTIONS?

Sinn Fein leader Mary Lou McDonald said on Monday that her first priority was to establish whether she could form a left-wing coalition without Fianna Fail or Fine Gael. Analysts say this option is unrealistic, both numerically and politically. Instead, there appear to be three options:

FIANNA FAIL + SINN FEIN + OTHER Fianna Fail leader Micheal Martin has declined to repeat earlier firm refusals to consider a coalition with Sinn Fein, saying only that there were significant incompatibilities in policy. To reach a majority, such a coalition may need a third partner, as well as the approval of a sceptical Fianna Fail rank and file and reluctant lawmakers. Fine Gael has repeated its pledge not to go into coalition with Sinn Fein, citing its IRA past and differing economic policies.

FINE GAEL + FIANNA FAIL + OTHER Fianna Fail and Fine Gael have alternated in power since the foundation of the state in 1922, but have never formed a coalition together. Fine Gael offered to do so after the last election but Fianna Fail declined, instead helping to keep Varadkar’s minority government on power by supporting it on major issues from the opposition benches. This time, they would also need the support of at least one other party to secure a majority in the 160-seat parliament. Fianna Fail insisted before the election it would not strike such a coalition, as it would leave Sinn Fein as by far the biggest opposition party, to the possible detriment of one or both governing parties.

ANOTHER MINORITY GOVERNMENT

Fianna Fail could try to lead a mirror image of Varadkar’s minority government, relying on Fine Gael for case-by-case support. However, with a lower number of combined seats, both parties have said the option appeared unlikely this time.