Former US president Bill Clinton has made an impassioned plea for people to finish the peace building of Martin McGuinness.
Thousands of people thronged the streets of Derry's Bogside as the veteran Sinn Féin figure's funeral took place in St Columba's Church.
Mr McGuinness died on Tuesday from a rare heart condition aged 66.
Mr Clinton and ex-DUP first ministers Peter Robinson and Arlene Foster were among those attending Thursday's requiem mass.
Looking down on a coffin draped in an Irish Tricolour, the former US president, who was central to the Good Friday Agreement negotiations, implored today's leaders to pick up where Mr McGuinness left off.
Bill Clinton's full speech at the funeral of Martin McGuinness https://t.co/9poLXrLATi
— RTÉ News (@rtenews) March 23, 2017
"He persevered and he prevailed. He risked the wrath of his comrades and the rejection of his adversaries," Mr Clinton said.
"He made honourable compromises and was strong enough to keep them and came to be trusted because his word was good.
"And he never stopped being who he was. A good husband, a good father, a follower of the faith of his father and mother and a passionate believer in a free, secure, self-governing Ireland.
"The only thing that happened was that he expanded the definition of 'us' and shrank the definition of 'them'."
Mr Clinton added: "Our friend earned this vast crowd today. Even more, he earned the right to ask us to honour his legacy by our living. To finish the work that is there to be done."
Mr Clinton spoke briefly with the McGuinness family after his passionate eulogy and touched the coffin as he walked by.
Mr McGuinness's beloved Bogside neighbourhood came to a standstill as his coffin was walked to St Columba's Church, led by a lone piper.
President Michael D Higgins and his predecessor, Mary McAleese, also attended the funeral, as did Taoiseach Enda Kenny and former taoiseach Bertie Ahern.
There was a round of applause inside the church as Mrs Foster took her seat.
Former British prime minister Tony Blair did not travel to Derry for the ceremony, which he had been expected to attend.
Fr Canny talks about the friendships McGuinness made with his political rivals & says their respect is an "eloquent testimony" to his memory pic.twitter.com/dCr72ALneI
— RTÉ News (@rtenews) March 23, 2017
Fr Michael Canny was chief celebrant for the funeral mass, with Bishop of Derry Donal McKeown concelebrating.
In his Homily, Fr Canny said Mr McGuinness is someone who has been acknowledged in recent days as a politician who spent year after year moving the community towards peace.
Fr Canny recounted how in his last recorded interview Mr McGuinness said he was not worried about what historians thought about him, he said he would leave that to the judgement of the people.
He asked only that he be judged fairly.
Reverend Harold Good, former president of the Methodist Church in Ireland and a member of the panel which oversaw IRA decommissioning, and Rev David Latimer of the First Derry Presbyterian Church also spoke from the altar.
"Martin had a good heart but I would go a bit further to say, he had a big heart that enabled him to reach out in quite unexpected ways to both to friends and to foes alike," Rev Latimer said.
"Martin has bequeathed to us a better place to live."
"It was his commitment to create a new order of cooperation where we will be able to live in relationship and not out of relationship and get to know each other better.
"In memory of the man whose friendship I will always treasure we must together, all of us, pledge to keep on doing what he was doing and to persevere in the pursuit of peace.
Enda Kenny and Bill Clinton, led by Gerry Adams, shake hands with family members at Martin McGuinness's funeral. pic.twitter.com/xKv4P9ITnp
— RTÉ News (@rtenews) March 23, 2017
Sinn Féin leader Gerry Adams delivered the graveside oration saying: "there was not a bad Martin McGuinness or a good Martin McGuinness. There was simply a man, like every other decent man or woman, doing his best."
He went on to say that "without Martin there could not have been the type of peace process we’ve had.
"Much of the change we now take for granted, could not have been achieved."
He said his friend was "tough, assertive and unmovable when that was needed. Dogmatic at times.
"Wimps don’t make good negotiators - neither do so-called hard men. Martin learned the need for flexibility."
Adams asks unionists and nationalists to respect one another, and to celebrate and enjoy each other's differences. pic.twitter.com/e2Ycq3xPGK
— RTÉ News (@rtenews) March 23, 2017
McGuinness's legacy lauded
Throughout his ten years as deputy first minister, Mr McGuinness made the return journey from Derry to Belfast at least four times each week and he became known for his stamina.
The full details of his activities in the IRA will never be known. But it is the recognition of his unique role in the peace process for more than two decades that has the likes of Mr Clinton travelling to Derry to pay their respects.
Though thousands of supporters have lauded the legacy of Mr McGuinness, his death has drawn a very different response from many victims of the IRA, with some bereaved relatives not prepared to forgive him for his paramilitary involvement.
Former US president Barack Obama last night issued a statement paying tribute to Mr McGuinness, saying: "I send my condolences to the family and many friends of Martin McGuinness, a man who had the wisdom and courage to pursue peace and reconciliation for his people.
"His leadership was instrumental in turning the page on a past of violence and conflict that he knew all too well. In our own meetings, I was always struck by his good humour and persistent belief in a better future for the people of Northern Ireland.
"May Martin rest in the peace that he pursued in life, and may his example inspire others to follow a path of reconciliation."
- McGuinness a 'pivotal and crucial figure' in peace process - Adams
- McGuinness: From IRA commander to political leader
- IRA bomb victim's sister says truth died with McGuinness
- A political journey in pictures
- McGuinness retired from politics just months ago
Political leaders at Westminster and Belfast yesterday commended Mr McGuinness for his contribution to the peace process.
British Prime Minister Theresa May told parliament she could never condone the ex-IRA commander's violent past but she credited his "indispensable" role in moving the Republican movement away from armed conflict.
Mrs Foster said Mr McGuinness's legacy was "complex and challenging".