Media playback is unsupported on your device Media caption The Queen shook hands with former IRA commander Martin McGuinness.

The final day of the Queen's two-day visit to Northern Ireland was marked by an historic handshake and a huge party.

Her Majesty and former IRA commander Martin McGuinness shook hands for the first time.

The meeting between the monarch and Northern Ireland's deputy first minister took place at a charity event in Belfast on Wednesday morning.

In the afternoon she attended a Diamond Jubilee party attended by 20,000 in Stormont.

The Queen and Mr McGuinness shook hands at a private meeting and later shook hands in public.

The private meeting, in a room at the Lyric Theatre, involved a group of seven people, including Irish President Michael D Higgins and Northern Ireland's First Minister Peter Robinson.

Image copyright AFP/Getty Images Image caption The Queen and Duke of Edinburgh were driven through the grounds of Stormont

It is understood Mr McGuinness welcomed both the Queen and the Irish president in Irish.

The deputy first minister is said to have commented on the Queen's visit to Dublin last year, and in particular her comments regarding all the victims of the Troubles.

Analysis Not only did the Queen and Martin McGuinness shake hands, they wore a matching colour. Needless to say it was green. It may be a trivial point, but it spoke volumes. The image will help Sinn Féin reach out to voters, previously reluctant to support a party linked to the IRA. But the picture could lose them a small number of party members for whom a meeting with the British head of state is a republican step too far. As for the Queen, it will not be the favourite moment of her 60-year reign, but it is certainly one of the most significant.

A Sinn Féin spokesman said: "He emphasised the need to acknowledge the pain of all victims of the conflict and their families."

Sinn Féin said Mr McGuinness told the Queen that their meeting was a "powerful signal that peace-building requires leadership".

Later, as the Queen left to continue her Diamond Jubilee tour of Northern Ireland, the pair shook hands again, this time in public.

Reconciliation

As they shook hands for a second time, Mr McGuinness wished the Queen well in Irish, which translates as: "Goodbye and God bless."

When asked how it was to meet the Queen, Martin McGuinness replied "very nice."

In 1972, it would have seemed like the most absurd fantasy that the Queen would ever shake hands with a leading figure from the Provisional IRA John Simpson, BBC World Affairs Editor From IRA leader to statesman

The main event had been billed as one to celebrate the role of the arts in contributing to reconciliation and peace-building and not as part of the Jubilee celebrations.

During the event, the Queen was presented with a gift of Belleek pottery to mark her Diamond Jubilee.

President Higgins said he and his wife, Sabina, had been delighted "to have the opportunity for a brief but very warm meeting" with the Queen.

He said it marked "another important step on the journey to reconciliation on this island".

The prime minister's official spokesman said the Queen's visit to the Republic of Ireland last year had "taken relations between the two countries to a new level".

The spokesperson added: "We think it is right that the Queen should meet representatives from all parts of the community."

Sinn Féin President Gerry Adams said he very much welcomed the meeting between the Queen and Martin McGuinness.

I think the vast majority of unionists will be pleased this happened because they know it was essentially a real gesture towards their sense of identity and their sense of allegiance Gerry Adams, Sinn Féin President

Speaking to reporters in Dublin, Mr Adams said: "It brings our journey of relationship building within this island and between these islands onto a new plane."

He added: "I think the vast majority of unionists will be pleased this happened because they know it was essentially a real gesture towards their sense of identity and their sense of allegiance."

"Whatever personal feelings Martin may have, no more than myself, doesn't come into it. It was a good thing for him to do and I commend him for it," he added.

Sensitivities

Those present at the Lyric event included the pianist Barry Douglas, poet Michael Longley and actors Adrian Dunbar and Conleth Hill.

BBC Northern Ireland's political editor Mark Devenport said the occasion at the Lyric had been specifically designed to meet Sinn Fein's sensitivities and to ensure that a ground-breaking encounter could take place.

"It is being stressed the arts event has a cross-border dimension and is not part of the Jubilee celebrations," he said.

For most people in Northern Ireland it is not about one moment of history but the opportunity to celebrate and give thanks for 60 very full years of Your Majesty's service to this nation Peter Robinson, First Minister

The Queen and Prince Philip later toured Titanic Belfast, a new visitors' centre located near where the ship was built. She has also unveiled a plaque to commemorate the visit.

She enjoyed a lunch which included traditional Irish soda bread, Comber potatoes, the sweet toffee yellow man, and ice cream.

In a speech at the lunch, First Minister Peter Robinson said: "I know for many in the media, the focus has been on a handshake and a photograph, but for most people in Northern Ireland it is not about one moment of history but the opportunity to celebrate and give thanks for 60 very full years of Your Majesty's service to this nation."

At the end of the day the Queen and Prince Philip were driven through the grounds of Northern Ireland's seat of government in an open-topped vehicle.

The royal motorcade was cheered by around 20,000 people attending a party to mark the monarch's 60-year reign.