Prince Charles was 30 years old when, in 1979, Lord Mountbatten, his beloved great-uncle and mentor (they called each other Honorary Grandfather and Honorary Grandson) and two relatives and a local boy were murdered by the IRA at Mullaghmore, Co Sligo, where Mountbatten had a summer home.
"He knew the danger involved in coming to this country," said Gerry Adams, whose official title was then vice-president of Sinn Fein. "In my opinion, the IRA achieved its objective: people started paying attention to what was happening in Ireland."
"I remember only too well feeling deeply angered when Lord Mountbatten and other relations were blown in to small pieces," Charles said when he visited Omagh after the 1998 bomb to try to bring words of comfort.
But he believes in forgiveness. As he put it a few years later to victims of 9/11: "At the time, I remember feeling intense anger, even hatred, of those who could even contemplate doing such a thing.
"But then I began to reflect that all the greatest wisdom that has come down to us over the ages speaks of the overriding need to break the law of cause and effect and somehow to find the strength to search for a more positive way of overcoming the evil in men's hearts."
He was fortunate to live long enough to develop such a philosophical attitude, for, in 1983, Sean O'Callaghan was dispatched to London to plant a bomb behind the royal box in the Dominion Theatre, timed to go off during a concert due to be attended by Charles and Princess Diana.
As Taoiseach Garret Fitzgerald would later confirm, O'Callaghan, who was working for the gardai, managed to abort the plot. The IRA never had such a good opportunity again.
Charles would have known about that narrow escape, as he knew that he was routinely denounced by republicans as 'Colonel-in-Chief of the Parachute Regiment, responsible for the Bloody Sunday massacre and other atrocities against the Irish people'.
Yet legitimate worries of the security service never stopped him making frequent visits to Northern Ireland, to show solidarity with those who valued the United Kingdom and to make common cause with victims of terrorism.
There were always nationalists who privately wished him well, but until recently, few would have been prepared to be seen with him in public.
It was Charles who was designated by the royal family after the first IRA ceasefire to make the first steps in bringing about a normalising of relationships with the Republic of Ireland and the wider nationalist community.
In 1995, he accepted an invitation to make an official visit to Ireland, where he said emotionally: "I have longed to come here ever since I can remember." The visit was opposed by republicans and by Peter Robinson, then deputy leader of the DUP, who said the royals were being used by a "treacherous government" to hand over Northern Ireland to the Republic.
It was not how Taoiseach John Bruton, or Prince Charles, saw it. To Bruton, this was the most significant event in his lifetime "to exorcise and sweep away the suspicion that existed between our two nations". In a heartfelt speech at a banquet in Charles's honour in Dublin Castle, Bruton said: "We welcome you as a friend," and he and Charles proposed toasts to their respective heads of state.
The Irish attendees at a packed British embassy party made it clear they had no sympathy with the thousands of protesters, whose activities included throwing a black coffin marked: 'Great Hunger – 1845-1849' in to the Liffey. Careful, patient choreography on the long and winding path to the Queen's visit included being the first member of the royal family ever to go to the Irish Embassy in London. It was 2010 and Charles expressed his hope "that we can endeavour to become the subject of our history and not its prisoners", thus prefiguring his mother's words in Dublin Castle the following year, when she memorably spoke of "being able to bow to the past, but not be bound by it".
I was one of the huge crowd of first and second generation Irish people who cheered him loudly. A few months before the Queen travelled to Ireland in May 2011, there was Charles's visit to St Malachy's Church in Belfast in 2011 alongside Peter Robinson, where they were welcomed by the Catholic bishop of Down and Connor, and the first minister said approvingly: "I think it should send out the indication that respect, understanding and tolerance is growing in Northern Ireland, and that's a good message."
The British royals have always tried hard to get close to all sections of British society, regardless of religion or race, but Northern Ireland posed exceptional problems.
Yet there, in June 2013, were Charles and Camilla for two days being cheered by children from a Catholic primary school and given a display of Irish dancing.
I hope Ireland, north and south, can acknowledge Charles's attempt to be a positive force on this island by wishing him a happy 65th birthday.