Northern Ireland’s outgoing health minister, Michelle O’Neill, has been named the new leader of Sinn Féin in the province, marking a generational change at the top of the republican movement.

It means that if Sinn Féin returns to Stormont after the 2 March assembly elections the 40-year-old could become either deputy first minister or even first minister depending on how well the party does in the poll.

If Sinn Féin and the Democratic Unionists are returned as the two biggest parties from their respective communities, then O’Neill will have to lead a fresh round of negotiations aimed at restoring a power-sharing government in Belfast.

O’Neill will become the first leader of Sinn Féin who does not have a direct IRA past.

She will replace Martin McGuinness, the IRA’s former chief of staff turned deputy first minister, who stepped down from the post in protest over the then first minister Arlene Foster’s handling of the “cash for ash” scandal that toppled the previous power-sharing administration.

McGuinness confirmed last Friday that due to ill health he would not stand in the forthcoming assembly elections, which were triggered by the fall of the Sinn Féin-DUP coalition. The Derry-born republican who became Sinn Féin’s chief negotiator during the peace process has a rare condition that attacks the heart, central nervous system and vital organs such as the kidneys.

Announcing O’Neill as the party’s next northern leader, the Sinn Féin president, Gerry Adams, said she was part of a new generation to take the party forward.

“As a united all-Ireland team, we will give her the space and support to find her own voice and continue the good work Martin pioneered,” Adams said.

O’Neill posted a video online in which she said: “It’s a huge honour, a really big, big privilege for me.”

Later at a press conference in Stormont, she added that she would continue McGuinness’s good work in relation to peace and power sharing. She said she was “following in the footsteps of a political giant”. “I have never been afraid of a challenge and I have never been afraid to act,” she added.

McGuinness said he was overjoyed at her appointment.

Asked about his own future in politics, McGuinness invoked a phrase once infamously used by Adams about the IRA’s possible return in the mid-1990s. “I haven’t gone away, you know,” he said.

Ireland’s foreign minister, Charlie Flanagan, congratulated O’Neill. “I believe we share the same determination to advance peace and stability in Northern Ireland for the benefit of all its people,” he said.

In preparation for O’Neill’s appointment, Sinn Féin had recently referred to her as the party’s “senior minister” at Stormont.

She was seen alongside Adams at a Sinn Féin-organised conference on a United Ireland in Dublin at the weekend.