The Rev Ian Paisley and Martin McGuinness today became Northern Ireland's first minister and deputy first minister at the start of a new era of power-sharing in the province.

With the prime minister, Tony Blair, the Irish taoiseach, Bertie Ahern, and other VIPs watching in the public gallery of the Northern Ireland assembly, the Democratic Unionist leader and the former IRA commander swept aside decades of enmity as they were sworn into office.

After the ceremony Mr Paisley and Mr McGuiness shared tea with the two prime ministers in front of the world's press. Mr Paisley joked with Mr Blair that he was just about to take office in his 80s, while Mr Blair was about to stand down. He was also heard to remark: "I wonder why people hate me so much, as I'm such a nice man."

Mr Paisley and Mr McGuinness were appointed without applause after a request by the new Speaker, William Hay, for a mark of respect for the late George Dawson, who was the Democratic Unionist party's MLA for East Antrim.

The nomination of Mr Paisley and Mr McGuinness set in train the nomination of 10 other devolved ministers to head government departments in the province and that of two junior ministers.

Mr Paisley's Democratic Unionists will head four ministries while Sinn Fein will control three.

First to be appointed was the DUP's Peter Robinson, as finance and personnel minister.

The return of power-sharing between unionists and nationalists in Northern Ireland has lessons for other conflicts around the world, Mr Blair insisted today.

Speaking just before the ceremony, Mr McGuinness said it marked "a fundamental change of approach, with parties moving forward together to build a better future for the people that we represent".

The Northern Ireland secretary, Peter Hain, hailed the new "chemistry" between Mr McGuinness and his political rival, the Rev Ian Paisley.

Mr Hain said: "There's been more preparation for this moment between the DUP and Sinn Féin, between Ian Paisley and Martin McGuinness and their ministerial party colleagues than ever before, and that's what fills me with optimism - not just that the darkness and horror of the past are now behind us but that there is a real prospect of this government working."

It was extraordinary "given that until a few weeks ago they had never passed a word between each other - even walking down the corridor at Stormont, the DUP would not acknowledge a republican", Mr Hain said.

"I don't think there is any way back. I can't conceive of a request for direct rule again from London ever to be made from Northern Ireland's politicians, any more than I could see Wales or Scotland making that request.

"We really are at the dawn of a new democratic future."

Mr Paisley and Mr McGuinness will head an administration of 10 ministers and two junior ministers drawn from the DUP, Sinn Féin, the Ulster Unionists and the nationalist Social Democratic and Labour party.

The agreement marks an extraordinary change in the relationship between Mr Paisley and Mr McGuinness, who were once the fiercest of enemies but have been sharing jokes in the past few weeks in advance of power-sharing.

Both Mr Paisley, 81, and Mr McGuinness, 56, have spent time behind bars in their extremist pasts.

Mr Paisley was jailed in 1969 for leading an illegal demonstration against Catholic marchers who were demanding equal rights in voting, housing and employment.

His strident, stubborn invective fanned the flames of Protestant mob violence and helped to delay by decades today's historic compromise.

Mr McGuinness served two short sentences in the 1970s for IRA membership - and spent many more years on the run while serving in the IRA's ruling "army council".

The Guardian's Northern Ireland correspondent, Owen Bowcott, said: "The personal chemistry between the two seems to be very good. Martin McGuinness says that he calls Ian Paisley 'Ian', Mr Paisley says he calls McGuinness 'deputy'.

He added: "Paisley's speeches have reached out across the divide. He has been conciliatory and does not seem to be deflected by the resignation of one of two DUP councillors and an MEP.

He described today's ceremony as a "pantomime" and said the politicians needed to get down to the real work of building a better future for Northern Ireland.

Bowcott said: "The mood of the past six weeks has been one of incredible cooperation. There will be tough and difficult days ahead, but all the signs now are that it will work."

The return of devolved government came about as a result of a deal in March struck by Mr Paisley and the Sinn Féin leader, Gerry Adams.

All the new government ministers took an oath of office that requires them "to uphold the rule of law based as it is on the fundamental principles of fairness, impartiality and democratic accountability, including support for policing and the courts".

The first meeting of the power-sharing executive is scheduled for later this week.

In October 2002, allegations of intelligence-gathering within Stormont led to the suspension of power-sharing institutions.

For Mr Blair and Mr Ahern, the return of power-sharing is the culmination of 10 years' work. Northern Ireland is viewed as one of the main policy successes of Mr Blair's decade in office. Mr Ahern, who is campaigning for re-election, counts it as one of his greatest achievements.

Earlier Mr Blair insisted that, even though some critics have claimed Iraq will overshadow the achievements in Northern Ireland, he was right to go with his gut feeling about the invasion.

"Ultimately, with some of these decisions, they are so difficult that you have to go with your instinct about what was right," he said. "Sometimes the judgment is not made immediately. It is made over time."

The new power-sharing government will include the DUP deputy leader, Peter Robinson, as finance minister; Sinn Féin's Caitriona Ruane as education minister; the DUP's Nigel Dodds as economy minister; the Ulster Unionist leader, Sir Reg Empey, as employment and learning minister; the SDLP's Margaret Ritchie as social development minister; Sinn Féin's Conor Murphy as regional development minister; the DUP's Arlene Foster as environment minister; Ulster Unionist Michael McGimpsey as health minister; Sinn Féin's Michelle Gildernew as agriculture minister, and the DUP's Edwin Poutts as culture minister.