Left unresolved was whether Northern Ireland would ever be reunited with the predominantly Catholic Irish Republic. The Good Friday Agreement provided that that could happen only with the consent of Northern Ireland, and it made it likely that Ulster and its Protestant majority would remain in perpetuity — along with the legacies of killings and religious enmities.

Once banned from entering Britain, Mr. McGuinness won a seat in the House of Commons in London; ran unsuccessfully for the presidency of Ireland in 2011; visited prime ministers several times at 10 Downing Street; met Presidents Bill Clinton, George W. Bush and Barack Obama at the White House; and shook hands twice with Queen Elizabeth II.

“This is the side of his political life that McGuinness wants the Irish people to remember: the reformed man, the young, hotheaded idealist who learned the error of his ways and forged peace, an achievement that still wins him plaudits from around the world,” the British magazine New Statesman said in 2011. “To some in Ireland he is a hero — a man who stood up for the oppressed, who fought the British. To others, he was, is and will always be a criminal.”

James Martin Pacelli McGuinness was born in Derry, Northern Ireland, on May 23, 1950, one of seven children of William and Peggy McGuinness, a Catholic family that shared two bedrooms and an outdoor toilet in the crowded slum of Bogside, a setting for much violence during the Troubles. His father worked in an iron foundry, and his mother in a shirt factory. The parents attended Mass and took communion daily, and they gathered their six sons and daughter nightly for a recitation of the rosary.