Media playback is unsupported on your device Media caption Gerry Adams says Martin McGuinness "was not a terrorist"

Martin McGuinness was "not a terrorist" but a "freedom fighter", Sinn Féin leader Gerry Adams has claimed.

He was speaking at the graveside following the funeral of Mr McGuinness, a former IRA leader turned politician.

Earlier, thousands of mourners heard ex-US President Bill Clinton say the people of Northern Ireland must finish the work he started.

Mourners included Democratic Unionist Party leader Arlene Foster, who received applause in the church.

Media playback is unsupported on your device Media caption "He worked with two prime ministers and shook hands with the Queen"

Mr McGuinness, an ex-paramilitary turned Sinn Féin politician, died on Tuesday aged 66, after a short illness.

Thousands of people packed the streets of his native Bogside, a republican area of Londonderry, as his funeral took place, and many of them followed the coffin of Mr McGuinness onward to the city cemetery.

Image copyright AFP Image caption Thousands followed the hearse to the city cemetery

President Clinton, who was central to the Good Friday Agreement peace negotiations, told mourners he "came to treasure every encounter" with Mr McGuinness.

Speaking after the funeral, President Clinton told BBC News NI why it was so important for him to be there.

"We spent a lot of time together when I was president and I wanted to honour him for what he did, for changing from war to peace and to emphasise that it's one thing to make a peace, another thing to make it work and that's an endless process.

Media playback is unsupported on your device Media caption 'Making peace work is an endless process' - Bill Clinton

"I think all these people, who justifiably, respect the fact that he changed from war to peace need to re-commit themselves to finish the work that needs to be done".

Image copyright Getty Images Image caption Mr McGuinness is being buried in the city cemetery

"Our friend earned this vast crowd," he said. "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."

Fr Michael Canny, who was a personal friend of Mr McGuinness, said there were people in the church "whose presence would have been unthinkable only a generation ago".

Image caption Former first minister Arlene Foster and Michelle O'Neill shake hands at the funeral

Image copyright EPA

"The presence of those political rivals and opponents who have come to pay their respects is the most eloquent testimony to the memory of Martin McGuinness," he said.

Mr McGuinness was a "man of simple tastes who ascended to the political summit," he continued.

Image copyright Getty Images Image caption Martin McGuinness' family in the church

Image copyright Getty Images Image caption The service took place at St Columba's Church, Long Tower

"He visited the White House, Downing Street and Windsor Castle, but only ever felt at home in his beloved Bogside, returning to his wife and family at every opportunity," Fr Canny said.

Mr McGuinness was a "complex man, born into a community where faith, Catholicism and nationalism were intertwined" and his life was a "remarkable journey", he added.

Media playback is unsupported on your device Media caption Rev Harold Good reflects on the journey towards decommissioning

"He was the Sinn Féin leader who first shared power, then became friends with the late Dr Ian Paisley; he was the IRA commander who became a mainstay of the peace process."

Mr McGuinness' grandchildren read prayers and the Rev Harold Good, a former Methodist Church president, and the Rev David Latimer, from First Derry Presbyterian Church, also spoke.

Image caption Former US President Bill Clinton beside the coffin of Martin McGuinness

A message was read out on behalf of Archbishop Eamon Martin, leader of the Catholic Church in Ireland, who could not attend the funeral but had visited the McGuinness family on Wednesday.

Media playback is unsupported on your device Media caption Fr Michael Canny: "Martin realised the time for peace had come"

Mr McGuinness' coffin was draped in an Irish tricolour but there were no paramilitary trappings for the one-time IRA commander.

Taoiseach (Irish Prime Minister) Enda Kenny, Irish President Michael D Higgins, Secretary of State James Brokenshire and former Scottish first minister Alex Salmond were among the high-profile political figures at the church.

At the scene

Image copyright Getty Images

By Ciaran McCauley

On Thursday afternoon, the city of Derry came to a standstill for the funeral of Martin McGuinness.

Thousands lined the short route from his home in Westland Street to his parish church, Long Tower.

Onlookers crowded along pavements and stood on balconies as he made his final journey.

They often broke into applause as he passed through the Bogside, an area that saw some of the most infamous events of the Troubles.

Mr McGuinness' legacy and impact - his shift from IRA leader to pivotal architect of the peace process - will be debated for decades.

Regardless, this is the closest the city of Derry has ever come to hosting a state funeral.

Media playback is unsupported on your device Media caption Former US President Bill Clinton meets the McGuinness family

Numerous politicians from Northern Ireland's Assembly were also there, as was police chief George Hamilton.

Writing in the Belfast Telegraph, Mrs Foster said she recognised some would be critical of her decision to attend the funeral of a former IRA leader but added she wanted to pay "respect to his family".

Image copyright PA

Following the service, Mr McGuinness was buried in the republican plot in the city cemetery where Sinn Féin leader Gerry Adams delivered a graveside eulogy.

He said Mr McGuinness "was not a terrorist" but a "freedom fighter".

"He was also a political prisoner, a negotiator, a peacemaker, a healer," he said.

Image copyright AP Image caption Sinn Féin's Gerry Adams speaks at the graveside as Michelle O'Neill, left, and Mary Lou McDonald look on

He also appealed to unionists.

"Let us learn to like each other, to be friends, to celebrate and enjoy our differences and to do so on the basis of common sense, respect and tolerance for each other and everyone else - as equals," he said.

"Let me appeal also to nationalists and republicans - do nothing to disrespect our unionist neighbours or anyone else."

Folk singer Christy Moore sang the final song - the Time has Come - at the graveside.

Media playback is unsupported on your device Media caption Rev David Latimer: "Martin bequeathed us a better place to live"

The Irish tricolour flew at half mast at the official residence of the Irish president as well as the Dáil (Irish parliament) as a mark of respect for Mr McGuinness.

Image copyright PA Image caption Former SDLP leader John Hume, who is rarely seen in public these days, and his wife, Pat, heading into the church

He had been suffering from a rare heart condition, and he died at Altnagelvin hospital on Tuesday, with his family by his bedside.

Many tributes from across the political spectrum have been paid to the republican figurehead.

However, some victims of the Troubles have expressed revulsion at media coverage of his death, with critics saying that Mr McGuinness was lauded as a peacemaker despite never having apologised for his IRA past.