Image copyright Kelvin Boyes/Press Eye/pa wire

Sinn Féin and the DUP have re-entered devolved government in Northern Ireland after three years of deadlock.

DUP leader Arlene Foster was appointed as Northern Ireland's first minister, while Sinn Féin's Michelle O'Neill is deputy first minister on Saturday.

The two parties supported a deal to restore Stormont's political institutions.

Stormont's power-sharing coalition, led by the DUP and Sinn Féin, collapsed in January 2017.

Media playback is unsupported on your device Media caption Arlene Foster says parties must work for everyone

The first minister comes from the largest party in the assembly and deputy first minister is from the second-largest party.

The positions are known as a "diarchy" which means they are equal and govern together.

The deputy first minister is not subordinate to the first minister, despite the title.

'Differences'

Addressing the assembly, Mrs Foster said the politicians have "many differences".

"Michelle's narrative of the past 40 years could not be more different to mine," she said.

"I'm not sure we will ever agree on much about the past, but we can agree there was too much suffering, and that we cannot allow society to drift backwards and allow division to grow."

She added that it was "time for Stormont to move forward".

Media playback is unsupported on your device Media caption Michelle O'Neill addresses the new NI Assembly

Michelle O'Neill said it was her "sincere wish that 2020 brings real change".

She also pledged to immediately resolve the pay parity row that has led to industrial strike action among health workers.

She said: "I see no contradiction in declaring and delivering on our firm commitment to power sharing with unionism in the Stormont Assembly while also initiating a mature and inclusive debate about new political arrangements which examine Ireland's future beyond Brexit.

"Similarly, there is no contradiction in unionism working the existing constitutional arrangements while taking its rightful place in the conversation about what a new Ireland would look like.

"We can do this while maintaining our independent distinct political identities and working in the best interests of all of the people."

Image copyright PA Media Image caption Both prime ministers have welcomed the restoration of devolved government at Stormont

The prime minister called it a "momentous day".

"The parties of Northern Ireland have shown great leadership in coming together to accept this fair and balanced deal in the interests of everyone in Northern Ireland," Boris Johnson said.

Taoiseach (Irish prime minister) Leo Varadkar commended Northern Ireland's political parties "for their decision to put the people they represent first and make measured compromises to reach a deal".

"I look forward to working with representatives in Northern Ireland as they begin working together again on behalf of all people in Northern Ireland," he said.

Image copyright NI Assembly

Analysis by BBC News NI political reporter Jayne McCormack

The first day back was always going to bring its challenges - but despite some malfunctioning microphones, events in the chamber moved at pace.

The surprising move by the DUP to support a Sinn Féin speaker instead of the SDLP, already has some sceptics suspecting not much has changed when it comes to how the two biggest parties operated in the last mandate.

But there's no denying Parliament Buildings has a buzz about it again.

Arlene Foster and Michelle O'Neill now have to prove that they can share power and deliver on the commitments in the new Stormont deal.

The SDLP, Alliance and Ulster Unionists are back in the executive too - a sign they would rather be helping take decisions, than stuck outside looking in.

After the session ended, the new ministers were immediately met by their departmental officials: the task of getting down to business starts now.

Reacting to the return of Stormont, former Sinn Féin president Gerry Adams said the assembly provided a place to "moderate differences, and to define common ground".

"It doesn't have to be back on the streets, it doesn't have to be these mad radio talk programmes, it doesn't have to be who shouts and yells the loudest," Mr Adams told RTÉ's Week in Politics programme.

Five-party executive

All five main parties in Northern Ireland - the DUP, Sinn Féin, Alliance, SDLP and UUP - have joined the new executive.

MLAs - members of the legislative assembly - met at Stormont on Saturday.

Their first item of business at Stormont on Saturday was the election of Sinn Féin's Alex Maskey as the assembly's new speaker.

The DUP's Christopher Stalford; UUP's Roy Beggs and SDLP's Patsy McGlone are his three deputies.

Gordon Lyons (DUP) and Declan Kearney (Sinn Féin) will serve as junior ministers.

Alliance leader Naomi Long accepted the position of justice minister.

She said it followed conversations with Arlene Foster and Michelle O'Neill on Friday night.

Mrs Long said she was "honoured to have the support of all sides of the house".

With the exception of the role of justice minister, the posts are shared out using a system called D'Hondt, in which ministerial posts are allocated according to parties' representation in the assembly.

The other members of the executive are:

Minister for the economy: Diane Dodds (DUP)

Minister for education: Peter Weir (DUP)

Minister for agriculture, environment and rural affairs: Edwin Poots (DUP)

Minister for communities: Deirdre Hargey (Sinn Féin)

Minister for finance: Conor Murphy (Sinn Féin)

Minister for health: Robin Swann (UUP)

Minister for infrastructure: Nichola Mallon (SDLP)

Why is justice appointed differently?

The d'Hondt mechanism is used to appoint almost all the ministerial departments in the executive - meaning the departments are shared round the parties based on how many MLAs they have.

Justice is different though - it is elected by a cross-community vote.

This is because when the Northern Ireland Executive was first created in 1999 it was considered that it was not yet appropriate to devolve policing and justice powers. There was still a tense security situation and so those powers remained at Westminster.

In 2010 a deal was struck to devolve justice, but the DUP did not want a Sinn Féin minister to be able to hold the post.

Instead it was agreed any justice minister required a cross-community vote.

Image caption Robin Swann stood down as UUP leader in October due to family commitments

A big surprise was the appointment of Robin Swann as health minister.

It comes just three months after the UUP North Antrim MLA stepped down as party leader due to the impact the role was having on his "role as a husband and a father".

He told the BBC that the party considered health a major priority and "when we had the chance to take it, we did".

Mr Swann said he was going to hold the first and deputy first ministers to account and would not let them "play party politics with health".

What caused Stormont to collapse?

Relations between the DUP and Sinn Féin had deteriorated in recent years as the two parties were diametrically opposed not only on Northern Ireland's position within the UK, but also issues such as the Irish language; same-sex marriage; abortion and how to deal with the legacy of the Troubles.

But unexpectedly it was a row over a green energy scheme which pushed their relationship past breaking point.

The Renewable Heat Incentive (RHI) scheme was set up by DUP leader Arlene Foster when she was enterprise minister, but it ran over budget and at one point threatened to cost taxpayers £490m.

Sinn Féin demanded that Mrs Foster step aside as first minister during an inquiry into the RHI scheme and when she refused, they pulled out of government on 9 January 2017.

How was a deal struck?

Two key sticking points in the Stormont talks were around an Irish language act and the petition of concern.

The purpose of petition of concern is to protect one community from legislation that would favour another and a valid petition requires the signatures of 30 MLAs.

Image copyright PA

The new deal says there is to be "meaningful reform" of the petition, which would be "reduced and returned to its intended purpose" and would "only be used in the most exceptional circumstances and as a last resort, having used every other mechanism".

The deal would see legislation created for the appointment of both an Irish language commissioner and an Ulster-Scots commissioner.

Earlier, Irish language group Conradh na Gaeilge welcomed the deal as an "historic advancement" but added it "falls very much short" of promises for an Irish Language act.

Other key points in the deal include the Northern Ireland Executive settling an ongoing pay dispute with nurses and increasing policing numbers.