It was an image that millions never expected to see.

Queen Elizabeth II, smiling and wearing a mint-green hat and dress, extended a gloved hand Wednesday to an equally gracious Martin McGuinness, a former Irish Republican Army commander, in an encounter that marked a milestone in Anglo-Irish relations.

For decades, McGuinness was an avowed enemy of the British Empire — a representative of a paramilitary group that in 1979 killed the queen’s beloved cousin Louis Mountbatten with a bomb planted on his fishing boat.

Potent symbolism

But in a potent sign of just how far the peace process in Northern Ireland has come, the queen and McGuinness, now deputy first minister in Northern Ireland’s provincial government, exchanged pleasantries at a meeting in Belfast that would have been difficult for McGuinness’s Irish nationalist party, Sinn Fein, to stomach even a few years ago.

“You could see it as a last piece in a jigsaw peace process which has been very slowly and carefully put together over 20 years,” said Diarmaid Ferriter, a professor of modern history at University College Dublin.

Not all of Britain’s royalist tabloids viewed the gesture as easy for the queen. In an editorial published before the meeting, the Daily Mail worried that in shaking McGuinness’s hand, “the Queen will be performing one of the most distasteful duties of her reign” and offered a “suggestion”: “Her Majesty may care to wear gloves — and burn them afterwards.”

Hard-line Irish republicans accused McGuinness of selling out and ignoring the queen’s role as formal head of the British armed forces, members of which killed 13 unarmed people in 1972 during a march known as Bloody Sunday.

Organized by a charity in Belfast that works to bring Catholic and Protestant communities together, the carefully choreographed meeting was also attended by Peter Robinson, the first minister of Northern Ireland, and Michael Higgins, the president of Ireland.

When the queen departed, McGuinness wished her well with an Irish Gaelic phrase and reportedly told her it meant, “Goodbye and Godspeed.”

Earlier in the week, McGuinness described the upcoming event as “stretching out the hand of peace and reconciliation to Queen Elizabeth, who represents hundreds of thousands of unionists in the north.”

The queen helped clear the way for the handshake last year when she became the first reigning British monarch to visit Ireland since it gained independence from Britain in 1922. Her trip was hailed as a success and has helped reshape the language of Anglo-Irish relations, which are as warm as they have ever been.

Prince Charles, the queen’s eldest son, said in a recent television special that his mother’s 2011 visit to Ireland was “in many ways . . . her greatest achievement.” Her itinerary was marked by events acknowledging the strained and often bloody history between Britain and Ireland.

Sinn Fein boycotted that visit, but McGuinness has since spoken of how moved he was by many of the queen’s gestures, including her speech — partly in Irish Gaelic — at Dublin Castle and her placing a wreath at a garden honoring republicans who died fighting for Ireland’s freedom, often at the hands of the British.

Analysts said Wednesday’s meeting also represented a strategic move by the media-savvy Sinn Fein — not only the largest Catholic political party in Northern Ireland but also a growing political force in the Republic of Ireland — to bolster its image as a party that is relevant and in the public eye.

Peace is seen now as largely accomplished in Northern Ireland, where a stable Protestant-Catholic power-sharing government is in place.

Tensions remain

But several small IRA splinter groups still exist, and tensions persist in some neighborhoods that are almost exclusively Protestant or Catholic. On Tuesday evening, rioting in West Belfast left nine police officers with minor injuries.

But the political landscape in Northern Ireland has transformed dramatically since the “the Troubles,” the colloquial name here for the three decades of armed conflict and bloodshed that largely ended with the 1998 Good Friday peace accord.

Wednesday’s meeting was hardly the first in the peace process to be billed as a landmark event, but the queen’s two-day visit is yielding what are viewed as important symbols of reconciliation on both sides: the queen’s handshake with McGuinness; the sight of the queen and Prince Philip being driven around Wednesday in an open-topped Range Rover; and the announcement of her trip to Northern Ireland weeks in advance instead of on the day.

Gerry Adams, the president of Sinn Fein, a party committed to the unification of Northern Ireland and the Republic of Ireland, said in a statement Wednesday that the meeting’s “significance will be seen in how much we can build upon it.”

Although the 86-year-old monarch is the head of state of the entire United Kingdom — England, Scotland, Wales and Northern Ireland — observers noted that Adams referred to her in his statement simply as the “Queen of England.”