When the Queen visited Northern Ireland on her Silver Jubilee tour in 1977, she was, a British minister once confided, very anxious and "terribly, terribly tense".
When she had completed her last engagement under the tightest of security, he recalled that Prince Philip patted her hand and said: "There now, it's over. Unless they sink the Britannia we're safe."
In Belfast yesterday she managed a pleasant smile as she shook the hand of Martin McGuinness, once regarded as one of Northern Ireland's most dangerous men. Back in 1977, he was one of the men causing her anxiety. But that was then, and this is now.
He was initially the epitome of the IRA hard man, known for his flinty determination never to give up the "armed struggle" until Britain had been banished from Ireland by force. He was viewed within the IRA as its primary militarist.
In fact, one of his roles was to reassure those who had anxieties about the tendency of his colleague, Gerry Adams, to contemplate new directions for republicanism.
In 1986 he helped Mr Adams push through new measures, facing down internal critics by promising that a more political approach would not mean abandoning violence.
"They tell you the war against British rule will be run down," he declared at a party conference. "Shame, shame, shame. Our position is clear and it will never, never, never change: the war against British rule must continue until freedom is achieved."
But things changed. The long war, as republicans called their campaign, dragged on interminably with no sign that Britain would capitulate to the demand for withdrawal.
Mr McGuinness and Mr Adams began to explore other avenues and eventually opted for participation in a peace process. The violence continued for many years, but alongside it so did secret talks with the British and other governments.
Eventually it was made clear by other elements, including the Irish government and Bill Clinton, who was the US President, that if violence was abandoned the entry of Sinn Fein into peaceful politics would be facilitated. Tony Blair spent much time testing Sinn Fein. The two republican leaders met him so often that Mr McGuinness grew very fond of Chequers: "It's a fairly amazing place," he once enthused. "The scenery around it is absolutely beautiful – a very relaxed atmosphere."
Negotiations took years, with Sinn Fein seeking to extract maximum concessions before the IRA eventually decommissioned its weapons. Now it is a successful political party, in effect running a Northern Ireland administration in partnership with Unionists.
It took a long time to leave violence behind but eventually it did so, convincing Unionists, London and Dublin that the days of the gun were over. But eventually, once it was accepted that this was really the case, the path opened towards yesterday's historic handshake.Reuse content