The monarch and Northern Ireland’s deputy first minister met briefly when the Queen visited a theatre in Belfast to view an art exhibition.
A television cameraman and stills photographer were allowed to capture the historic moment, but no members of the public were allowed within a mile of the venue as police imposed a total exclusion zone amid fears of a terrorist attack.
Mr McGuinness, as he held the monarch's hands for a few moments, spoke to her in Irish and told her the words meant: "Goodbye and God speed."
In stark contrast to the cheering crowds who greeted the Queen when she visited Enniskillen yesterday, the sovereign was driven through deserted streets in a bullet-proof car for the meeting with the Sinn Fein MP.
Sections of the nationalist community are vehemently opposed to the meeting between the Queen and Mr McGuinness, who has become Northern Ireland’s deputy first minister since embracing the peace process.
The significance of the meeting can hardly be overstated; Mr McGuinness was allegedly a senior IRA commander at the time the terrorist group murdered Earl Mountbatten, a cousin of the Queen and uncle of the Duke of Edinburgh, in 1979, and for decades the Queen was a prime target for the IRA.
Mr McGuinness has said he had left the IRA by the time of Earl Mountbatten’s murder.
Politicians on both sides of the political divide have praised both the Queen and Mr McGuinness for their courage in going ahead with the meeting.
Some victims of IRA attacks believe it is wrong for the Queen to shake Mr McGuinness’s hand, while Mr McGuinness has been criticised by some republicans for engaging with the woman who symbolises British rule in Ulster.
Overnight more than 100 protestors fought running battles with police in Belfast, throwing 21 petrol bombs and injuring nine officers.
Every vehicle was removed from the roads around the Lyric Theatre, and no pedestrians were allowed in or out of the one-mile exclusion zone.
Yesterday she made her first visit to a Catholic church in Northern Ireland at the start of a historic two-day visit.
After the unqualified success of the Queen’s first visit to the Republic of Ireland last year, the monarch’s Diamond Jubilee visit to Ulster marks another milestone in Anglo-Irish relations.
Although the Queen has been to Northern Ireland 19 times before, her bold itinerary includes visits that would have been unthinkable little more than a decade ago.
Is it appropriate for the Queen to meet a former IRA leader?
The Queen, so long regarded as a target by Mr McGuinness, is believed to have shaken hands with him during today's meeting, a moment that will be every bit as important to the peace process as her arrival in Dublin last year.
Martin McGuinness said yesterday: "In shaking the hand of Queen Elizabeth I am effectively, symbolically, shaking the hands of hundreds of thousands of unionists."
Peter Sheridan, chief executive of Co-operation Ireland, a charity which promotes peace in Northern Ireland and the Republic, said the gesture would alter things irrevocably.
"From my perspective it's a huge act of reconciliation, you cannot underestimate how important this is," he added.
"Whoever would have thought we would ever be in this situation - I think it says a lot about healing, human dignity and treating each other with respect.
"I think after today all of us will say things have changed - for me that's the significance of it."
However last night nine PSNI officers were injured as youths threw petrol bombs and other missiles in the Broadway area of Belfast.
Republicans had erected an Irish flag and a sign which said "Eriu is our Queen" on Black Mountain, overlooking Belfast. Eriu is a goddess in Irish mythology.
Today the monarch will travel to Stormont in Belfast for a garden party attended by 22,000 guests in the grounds of the famous building.
Plans for the historic handshake are separate to the Queen's Diamond Jubilee tour which has taken her across the UK from Leicester to London as she celebrates her 60-year milestone this year.
Asked how David Cameron viewed the handshake, the Prime Minister's official spokesman said: "Clearly, there was a visit by Her Majesty to the Republic of Ireland last year. That has taken relations between the two countries to a new level.
"We think it is right that the Queen should meet representatives from all parts of the community."
The meeting took place at a celebration of culture at the Lyric theatre in Belfast which was attended by President of Ireland Michael D Higgins.
The initial handshake between the Queen and the former IRA commander remained private but farewells between the two individuals were filmed and photographed.
It comes after the Queen's groundbreaking visit to the Republic of Ireland last year when she laid a wreath at the Garden of Remembrance in Dublin, which honours republicans who died fighting British rule, followed by a tour of the headquarters of the Gaelic Athletic Association before she spoke Irish at a banquet in her honour.
The cultural gestures - seen as public displays of respect to the Gaelic language and sports that her predecessors had historically sought to curb - had a major impact across Ireland.
Yesterday in Enniskillen, where 11 people were killed by an IRA bomb planted under a war memorial on Remembrance Sunday in 1987, every step the Queen took was laden with significance.
For the past 40 years, security around Royal visits to Northern Ireland has been so tight that they remain secret until the moment they happen.
When the Queen visited Northern Ireland during her Silver Jubilee, at the height of the Troubles, she slept on a ship off-shore and was helicoptered to functions.
But this time, the Queen’s itinerary was published in advance, meaning she was greeted by cheering crowds waving Union flags in County Fermanagh, some of whom had stood in the rain from 4.30am to catch sight of her.
"It's a wonderful day for Enniskillin,” said the Very Rev Kenneth Hall, the Dean of Clogher. “We want to prove we are one community in an atmosphere of togetherness.”
Accompanied by the Duke of Edinburgh, the Queen, whose arrival was delayed by an hour after her flight was diverted to Belfast because of bad weather, attended a service of thanksgiving for her 60-year reign at St Macartin's Church of Ireland Cathedral, attended by both Protestants and Catholics, including the head of the Roman Catholic Church in Ireland, Cardinal Sean Brady.
The Queen waves to the public as she arrives for a Service of Thanksgiving in Saint Macartin's Cathedral in Enniskillen, Northern Ireland (AP Photo/Peter Morrison)
The Archbishop of Armagh, the Most Rev Alan Harper, gave a sermon in which he said the Queen’s conciliatory words and gestures in Dublin last year had allowed many to throw off the "shackles" that had been loosening since 1998's Good Friday Agreement.
The Queen later met survivors and relatives of the victims of the Enniskillen bombing in private, before making the short walk to St Michael’s Catholic church, which was filled with local community groups that had asked to meet her.
She then went on a brief walkabout, accepting flowers from well-wishers, some in the crowd chanted “We want the Queen!”
Crowds wave Union flags in Enniskillen, County Fermanagh, as they wait for the arrival of Queen Elizabeth II during a two-day as part of the Diamond Jubilee tour (PA)
Frank O'Reilly, 63, said: "We were told about two weeks ago she was coming and everybody's been excited since then.
"Given the present climate this has been a huge step forward for the Catholic and Nationalist communities."
But today's meeting with Mr McGuinness has divided the town. Stephen Gault, who lost his father, told Sky News: "Nobody has been brought to justice for Enniskillen so it's very hard for the families to accept Mr McGuinness shaking the Queen's hand."
Speaking ahead of the meeting Mr McGuinness made reference to a famous remark by Tony Blair before the 1998 Good Friday peace deal, saying: "There was a lot of talk in the past about someone feeling the hand of history on his shoulder.
"This is about stretching out the hand of peace and reconciliation to Queen Elizabeth who represents hundreds of thousands of unionists in the north.”
Less happy times: Martin McGuinness, centre, showing what were claimed to be security forces intelligence pictures of suspects at a provisional IRA press conference.
Gerry Kelly, a Sinn Fein MLA and a former IRA member, said of the meeting: "This is a huge ask for Republicans.
"It is symbolic in the sense that the Queen may be a grandmother who people in England and people orientated towards Britain here in Northern Ireland highly respect and love. But she is the symbol of British rule in Ireland."
Noel Whelan, a political commentator, told the FT: "This is part of Sinn Fein's strategy to broad its political appeal in the Republic and reach out to middle class support as it attempts to establish itself as a potential government partner in the south."