On 10 February, two days after the general election that upended Irish politics, Sinn Féin’s leader Mary Lou McDonald was on a walkabout in central Dublin. To an inaudible question from somewhere in the mob of news reporters surrounding her, McDonald gave a brisk reply. “I may well be the next Taoiseach, yes,” she nodded matter-of-factly, allowing herself the faintest of smiles.

It makes for fascinating footage: a woman, whose future as Sinn Féin leader was in doubt only months before, contemplating becoming Ireland’s prime minister.

The general election result represents a stunning victory for Sinn Féin and a historic realignment of the Republic of Ireland’s political landscape. After nearly a century in which power has passed back and forth between the two main centre-right parties – Fianna Fáil and Fine Gael – Sinn Féin won the popular vote, taking 24 per cent of first preferences and topping polls across the country.

With Sinn Féin acquiring 37 seats in the legislature (Fianna Fáil got 38 and Fine Gael 35), the republic’s two-party system is defunct. As the three parties embark on what will be a long and complex process of coalition negotiations, McDonald’s only regret is not standing more candidates in the election.

Sinn Féin’s surge is also a reversal of fortunes for McDonald. When she was elected as Sinn Féin’s first MEP in the Republic of Ireland in 2004, a headline in the Sunday Times read: “Shopaholic Trinity [College Dublin] girl is new face of Sinn Féin”. The narrative was that McDonald was one of a new generation of middle-class graduates joining Sinn Féin and transforming the party’s image, as it moved away from its days as the public voice of the IRA during the Troubles and towards being a coherent and successful political party.

When McDonald succeeded Gerry Adams as leader in February 2018, she bucked the Sinn Féin stereotype (hard-bitten, Northern Irish and male). As a middle-class, well-educated woman from an affluent suburb of Dublin, she promised to broaden the party’s electoral appeal, not least because she is what older members of Sinn Féin would have called a “lily-white”: someone who was never in the IRA.

More than a year into the job, however, McDonald was failing to make good on that promise. In the European and local elections of May 2019, her party lost two of its MEPs and dropped from 159 council seats to 81. There were no explicit calls for her to resign, but the consensus was that she would soon be gone if Sinn Féin’s electoral fortunes did not improve.

The general election result is the long-awaited realisation of Sinn Féin’s potential under its new leader. In recent decades, the party has bolstered its credentials as a left-wing progressive party. While the Irish Labour Party propped up austerity measures by Fine Gael in coalition between 2011 and 2016, Sinn Féin became a leading anti-austerity voice, and was at the forefront of the campaigns for change over social issues such as equal marriage and abortion. The party’s historical Euroscepticism, meanwhile, has been largely forgotten, as it now argues for a united Ireland within a reformed European Union.

Even after Adams – who had been an impediment to electoral success in the south of Ireland – had stepped down as leader, it wasn’t “smooth sailing for Mary Lou”, says a Sinn Féin colleague. It was only after reviewing its European and local election results in May 2019 that the party realised it was coming across as “too angry” and needed to improve its grass-roots campaigning.

Subsequently, three of the party’s spokespeople in the Irish parliament – Pearse Doherty (finance), Eoin Ó Broin (housing) and Louise O’Reilly (health) – together with McDonald, led Sinn Féin’s endeavour to reinvent itself as a credible alternative government. (Given Sinn Féin’s success, it is not surprising that these were the issues cited in the exit poll as the priorities of Irish voters.)

The paradox of Sinn Féin, however, is that McDonald would never accept the widespread notion that she, and her colleagues such as Doherty, Ó Broin and O’Reilly, represent a “new generation”, although they tacitly benefit from that perception. Nor would she agree with the idea that there is any discontinuity between them and older party figures who are often ex-IRA.

When McDonald was elected as leader in 2018, she staunchly aligned herself with the party’s republican past, telling delegates at the party’s conference: “Up the republic, up the rebels, agus Tiocfaidh ár lá” (“Our day will come” – a republican slogan popularised by the IRA hunger striker Bobby Sands in the 1980s).

As Ó Broin told me in last week’s New Statesman, Sinn Féin’s current policy objectives were always part of its agenda, “although in some senses the conflict got in the way of that project. There’s a really strong continuity over that 30-year period,” he said. “I’m proud of it.”

But Sinn Féin has entered a new era. It does not matter whether the party’s politicians believe there is a discontinuity with the party’s past: the voters have decided there is.