On Saturday, the Republic of Ireland held a general election. Sinn Fein won more votes than any other party, with 24.5 percent of the “first preference” vote, although another party, Fianna Fail, won one more seat. This is an enormous change in Irish politics.

While the Republic of Ireland is separate from Northern Ireland, many people outside of Ireland and the United Kingdom know Sinn Fein primarily as the party historically connected to the Irish Republican Army (IRA), a terrorist organization that put down its weapons as part of the Good Friday Agreement that brought peace to Northern Ireland. However, it is the only significant party that is organized in both Northern Ireland and the Republic of Ireland (which is unsurprising, since its main political ambition is to reunify Ireland).

Here’s what happened.

It took awhile to get the final results

Ireland uses a voting system called PR-STV (proportional representation with a single transferrable vote). Each constituency (electoral district) in Ireland has between three and five electoral seats, and many candidates contending for one of those seats. Voters list candidates in order of preference, saying who is their first choice, who is the second and so on, down to the last candidate.

This system is easy and intuitive for voters, but the counting is complex. If a candidate does really well in the first count, so that her number of first preferences exceeds a mathematically calculated quota, she may be elected immediately. If no one gets enough first preferences, then the candidates who did worst are eliminated, and their second preference votes are distributed to the remaining candidates. Alternatively, if someone won in the first count, her surplus votes (the votes in excess of the quota) are distributed to candidates in proportion to the number of second preferences each of them received. This process is repeated through third preferences, fourth preferences and so on until all the seats in the constituency are filled.

The result is a system in which voters have a lot of choice. Unlike in the United States and United Kingdom, a vote for a smaller party is not necessarily a wasted vote. However, as in all voting systems, it has its complex and arbitrary features. For example, the order in which the losing candidates are eliminated can have important consequences.

Sinn Fein did better than expected

No one expected that Sinn Fein would do as well as it did, including Sinn Fein. However, it could probably have done even better. Before the election, Sinn Fein worried that if it ran too many candidates, it might split its vote and not win many seats. As it turns out, it has just the opposite problem — more votes than it needed to get many of its candidates elected. The result is that some Sinn Fein candidates won with very big surpluses — which were distributed to other parties’ candidates rather than to Sinn Fein.

It will be awhile before we know what the next government is going look like

The emergence of Sinn Fein as a major party has turned everything upside down in Irish politics. It may be weeks, or even months, before a new government emerges. However, any new government will be a coalition government. No party has won enough support to govern on its own. The Fine Gael party was able to run a minority government the last time around with the support of independents and with Fianna Fail supporting it from outside the government, but this is extremely unlikely to happen again.

Fine Gael and Sinn Fein will not join up in a coalition government. The two are divided by deep historic enmities. Fine Gael’s identity is as the party of law and order. Sinn Fein is still closely attached to a paramilitary movement — the relationship between Sinn Fein’s leadership and the IRA’s Army Council is the topic of much speculation — and is firmly on the left.

It is theoretically possible that Sinn Fein could lead a government based on a coalition of smaller parties and independents, but it would be very hard to organize so many different groups and individuals. The most likely outcome is a coalition between Fianna Fail and Sinn Fein, with some independent support. This will not be particularly comfortable for Fianna Fail, which ruled out a coalition before the election and is worried Sinn Fein will steal its voters. However, Fianna Fail might prefer it to the obvious alternative — some new arrangement between Fianna Fail and Fine Gael, which would allow Sinn Fein to claim it was the only party truly committed to change, and increase its support in opposition.

Sinn Fein in government would mean real changes

During the campaign, Sinn Fein’s rise in the polls caused consternation among the Irish political elite. Now people are getting more used to the idea of Sinn Fein in power. After all, it is not the first time that a party with a dubious attachment to the Irish constitution (Sinn Fein used to claim the Republic of Ireland was an illegitimate entity) has entered government.

Fianna Fail began as a rebellious faction within Sinn Fein, which decided in the 1920s to properly enter Irish politics. It famously described itself as a “slightly constitutional party,” but went on to dominate Irish politics for decades. Another Sinn Fein splinter group, the Worker’s Party, made a similar transition in the 1980s, abandoning its paramilitary ties.

Some observers hope Sinn Fein will make the same kind of transformation, getting rid of its association with a terrorist organization and becoming more internally democratic.

Whether this happens, Sinn Fein has already said it will press for a “border poll” — a referendum — in Northern Ireland and the Republic of Ireland on Irish reunification. As the only party functioning on both sides of the border, this might strengthen it in the long run. Ironically enough, it has recently lost support in Northern Ireland, as voters have moved toward the center, suggesting that its mix of radicalism and electoral politics may be hard to maintain in the longer run.