For almost a century, political power in Ireland has been held by Fianna Fáil and Fine Gael. The two centrist parties have ruled in some form or another, be it through coalitions or confidence-and-supply arrangements with other smaller parties. Saturday’s general election has upended this political duopoly.

Sinn Féin topped the poll in first-preference votes for the first time, with a share of 24.5%. Fianna Fáil received 22.2%, while Fine Gael, in government since 2011, came third with 20.9%. Under Ireland’s proportional representation voting system, it will take several days for the calculations to be made to establish exactly how many seats each party will win. Once that’s clear, negotiations will begin to see who can somehow form a government.

Sinn Féin’s surge came as a surprise to many, not least of all to the party itself, following poor results in last year’s local and European elections, while an Irish Times opinion poll as recently as October estimated the party’s support at around 14%. As a result it cautiously fielded just 42 candidates as it sought to limit its losses. This means it will not see as many seat gains as this weekend’s success could have allowed and Fianna Fáil, which ran more candidates, will probably secure more seats. Despite this, Sinn Féin is now in the frame to be a partner in government for the first time in the Republic’s history.

Sinn Féin has been in government in Northern Ireland for more than a decade through power-sharing at Stormont. But when it started fielding candidates for the Dáil in Dublin in the late 1980s, it was perceived as a hardline fringe group with disturbing connections to the IRA and failed to gain a foothold. Many voters had strong moral objections to what they considered to be Sinn Féin politicians’ support for terrorism, or felt it was a single-issue party with little to offer beyond seeking the reunification of Ireland.

Irish general election: latest results Read more

However, particularly after the 2008 financial crisis, Sinn Féin reinvented itself on the mainstream left. It has seen a surge in support among younger voters. Exit polls from the general election suggest that Sinn Féin was the most popular party for all age groups under the age of 65 – with support highest in the 18-24 and 25-34 categories.

Gaining the youth and progressive vote has been many years in the making, helped by embracing social change in the 2015 referendum on marriage equality and the 2018 referendum on abortion – pushing for “yes” votes and playing a prominent role in the campaigns.

Play Video 13:29 Owen Jones asks Sinn Féin leader if Brexit could lead to a united Ireland – video

The party has also been quick to identify and prioritise other issues affecting younger people, most notably Dublin’s housing crisis. Sinn Féin’s housing spokesman, Eoin Ó Broin, is among the party’s strongest media performers and has pledged a series of policies including a rent freeze, which has secured the votes of a generation trapped in a spiral of eye-watering rents or stuck at home with their parents.

By contrast, Fine Gael and Fianna Fáil, which were in a confidence-and-supply arrangement during the last government, have been accused of inaction on the issue, putting landlords’ needs above those of renters. The issue was brought into distressing focus in January when a homeless man in Dublin was accidentally lifted by the prongs of an industrial vehicle, as council staff tasked with tidying up the city’s streets removed his tent without realising someone was inside. The man was treated for “life-changing” injuries and the incident was felt by many to represent the very worst aspects of the housing crisis.

In 2018, following the retirement of its president, Gerry Adams, Sinn Féin cemented its reinvention through the election of Mary Lou McDonald as leader. Adams epitomised the previous generation of the party; men with northern accents, now aged in their 60s or 70s, who had long associations with the violence of the Troubles. Adams denies ever having been a member of the IRA, but the allegations have cast a long shadow over his career, making him unpalatable to many “soft nationalist” voters.

McDonald stood in stark contrast: a woman in her late 40s, Dublin-born, privately educated and a graduate of Trinity College, she represented a fresh face and was poised to gather more mainstream appeal particularly among female and middle-class voters. Her approach to the Troubles has been less triumphant and more compassionate, often keen to express her sadness at lives lost “on all sides”.

In the election campaign, Sinn Fein’s historic connections to the IRA were raised during televised leadership debates. Most prominently, McDonald was challenged on how her party colleague Conor Murphy had spoken about the murder of Paul Quinn in 2007 by Republicans, in which he appeared to be derogatory about the victim and wrongly connected him with criminality – Murphy subsequently apologised for his comments.

The taoiseach, Leo Varadkar, and Fianna Fáil’s leader, Michéal Martin, both emphatically ruled out going into government with the party. Varadkar said Sinn Féin was “not a normal party” and expressed concern about allegations that emerged during Northern Ireland’s cash-for-ash scandal that unelected ex-IRA men were still being consulted about Sinn Féin ministerial decisions. Martin echoed similar sentiments: “I could never be sure in terms of Sinn Féin in terms of who you are dealing with. Is it unelected officials in Belfast who rule the roost?”

Dredging up the Troubles, however, failed to cut through to younger voters in the Republic, many of whom have little or no personal memory of that time.

It remains to be seen over the coming days and weeks whether Sinn Féin will manage to enter government and, if so, how prominently. Regardless, it’s clear that Irish politics has been changed utterly by the party’s sudden surge, with a new generation of voters keen to focus on the challenges of the present – from the housing crisis to social justice – above the controversies of the past.

• Siobhán Fenton is a Belfast-based journalist and author of the book The Good Friday Agreement