She tried to keep it short and sweet. He had other ideas, trying to strike up a conversation, so the exchange would linger. In the end, she just smiled politely, nodded her head beneath a lime green hat, and moved on to the next person.
This was, of course, no ordinary handshake.
The exchange Wednesday between the Queen and Martin McGuinness, the onetime commander of the Provisional Irish Republican Army, symbolized a striking gesture of reconciliation between the two figures who, not so long ago, were archenemies – their rivalry such that their handshake drew comparisons to that between Yitzhak Rabin and Yasser Arafat.
While that handshake lasted just a moment, it was actually years in the making, and viewed as concrete proof of the success of the peace process accelerated by the Queen's visit to the Republic of Ireland last year. At that time, she managed to win over many critics of the monarchy with a message of reconciliation. But resentments still linger on both sides of the historic conflict.
Indeed, the Queen's enmity with Mr. McGuinness was also deeply personal. The Queen's cousin – and her husband's uncle – Lord Mountbatten was killed by a remote-controlled bomb on his small fishing boat off the coast of Ireland in 1979, along with his 14-year-old grandson and the 15-year-old boatman.
The IRA issued a statement claiming responsibility at the time. "This operation is one of the discriminate ways we can bring to the attention of the English people the continuing occupation of our country," it read.
More than 30 years later, behind closed doors, the Queen and Mr. McGuinness, now Northern Ireland's Deputy First Minister, shook hands at an arts event in Belfast's Lyric theatre. They shook hands a second time as they left, in front of the cameras.
Mr. McGuinness, for his part, signalled his willingness to turn the page on the past ahead of his meeting with the British monarch.
"In shaking the hand of Queen Elizabeth, I am effectively, symbolically, shaking the hands of hundreds of thousands of unionists. I think that is a good thing," he said.
While the Queen did not comment publicly about their meeting, others called it an act of bravery.
"I think it is fantastic that we have come so far. The Queen's is a magnificent gesture and thoroughly typical because it must be very difficult for her. It is a sign of how much has changed," Tony Blair, Britain's former prime minister, said in an interview with The Guardian.
The remarkable rapprochement reflects another unlikely story – Mr. McGuinness' journey from paramilitary to politician.
Still known to some as the "IRA godfather of godfathers," he joined the organization as a young man. By the age of 21, he was second in command of the IRA in Derry, a rank he held on Bloody Sunday in 1972, when 14 civil rights protesters were killed by British paratroopers. He claims he left the organization in 1974, after being jailed for being caught with a car laden with explosives.
After his release, he became increasingly involved in Sinn Fein, the political wing of the republican movement. He was elected to the Northern Ireland Assembly at Stormont in 1982, and to the Northern Ireland Forum in 1996.
Mr. McGuinness became Sinn Fein's chief negotiator in the Good Friday Agreement talks.
Following election to the new Northern Ireland Assembly, Sinn Fein nominated him to become education minister. He was re-elected to Westminster Parliament in 2001, 2005 and 2010, where he has refused to sit, like other members of his party.
While his handshake with the Queen was inspirational to some, others found it repugnant.
Writing in the Daily Mail, Andrew Pierce argued British Prime Minister David Cameron had put the Queen on the spot, forcing her to meet "a terrible man on British soil."
The Daily Telegraph published a scathing commentary penned by Reverend Peter Mullen, a priest with the Church of England, who wrote: "The vision of our gracious Queen in her Diamond Jubilee year being obliged to extend her noble hand to 'Commander' Martin McGuinness is enough to turn the stomach."
Meanwhile, elements of Sinn Fein were also apparently displeased with Mr. McGuinness for agreeing to the meeting, although Gerry Adams, the president of the party, was quoted in reports as saying it "is the right thing to do, at the right time and for the right reasons."
In front of the cameras, the Queen did not say anything, simply taking Mr. McGuinness's hand in her own.
As they parted he offered her the briefest farewell, in Irish, using a phrase that meant: "Goodbye and God's speed."