The head of the Irish Catholic Church has said partition causes him "a deep sense of loss and sadness". Archbishop Eamon Martin was addressing a service to mark the centenary of Ireland being divided and the formation of Northern Ireland.

In 1921, the island was divided into Northern Ireland and the Irish Free State. British Prime Minister Boris Johnson joined 150 guests from both sides of the border at the event, with Archbishop Martin saying that for the past 100 years, partition had polarised people on this island.

"It has institutionalised difference, and it remains a symbol of cultural, political and religious division between our communities," he said. He told the service in Armagh's Church of Ireland Cathedral that he also felt churches could have gone further.

"I have to face the difficult truth that, perhaps, we in the churches could have done more to deepen our understanding of each other and to bring healing and peace to our divided and wounded communities." Speaking afterwards, the prime minister said: "It has been very moving to be here today and see the way in which people from very different perspectives have come together."

Mr Johnson said that Northern Ireland was an incredible part of the country and that it had an amazing future. I am a passionate unionist and, of course, I believe the future is within the United Kingdom."

The Queen had been due to attend the service but was unable to travel for medical reasons. Irish president Michael D Higgins declined an invitation. The Armagh church service was organised to "mark the centenaries of the partition of Ireland and the formation of Northern Ireland".

President Higgins said that the title of the service made it inappropriate for him to attend as head of state. Sinn Féin, including Northern Ireland Deputy First Minister Michelle O'Neill, also decided not to attend.

However, Colum Eastwood, the leader of Northern Ireland's other nationalist party, the SDLP, was present. Among others at the service were Northern Ireland First Minister Paul Givan, of the Democratic Unionist Party (DUP); DUP leader Sir Jeffrey Donaldson; Ulster Unionist Party leader Doug Beattie; Alliance leader Naomi Long; Northern Ireland Secretary Brandon Lewis and Northern Ireland's chief medical officer Sir Michael McBride.

Two representatives from the Irish government were also present - Minister for Foreign Affairs Simon Coveney, from the Fine Gael party, and chief whip Jack Chambers, from Fianna Fáil. With Assembly Speaker Alex Maskey, a Sinn Féin member, not attending, deputy speaker Roy Beggs formally represented the Northern Ireland Assembly.

The event, titled "A Service of Reflection and Hope", was organised by the leaders of the main Protestant and Catholic Churches. It began with the ringing of the cathedral bell before the Dean of Armagh, Rev Shane Forster, sent his good wishes to the Queen.

Welcoming the congregation in both English and Irish, he said: "Our past has shaped us and scarred us, it has divided us. And, yet, it has also, on occasion, brought us together."

The leaders of Ireland's main churches delivered their personal reflections on the creation of Northern Ireland. The Moderator of the Presbyterian Church in Ireland, Dr David Bruce, said: "I grieve the times when fear has held us back from building relationships with those with whom we differ.

"If we are to build a better future, then we must recognise our own woundedness and our responsibility to care for the wounds of one another." Dr Ivan Patterson, the president of the Irish Council of Churches, said. “We need to learn from the example of young people.

"They are a generation who want to build peace, a generation who respect and care for this planet in solidarity with the poorest and most vulnerable here and around the world."

Church of Ireland Primate Rev John McDowell said: "I am hopeful. Hopeful in a new generation who know that the big problems we've landed them with, especially climate change and economic inequality, can only be tackled together.

"I think there are already signs that the next generation will see the things that we obsessed about as secondary and place their priorities elsewhere. As we lament our failures, sorrows and pain, and recognise our wounded yet living history, may we with a united voice commit ourselves to work together for the common good, in mutual respect and with shared hope for a light-filled, prosperous and peaceful future."

The main sermon was given by the president of the Methodist Church in Ireland, Rev Dr Sahr Yambasu, who told the congregation: "We have come a long way - not just a century but centuries. During that time people have cared for one another and made efforts to build community.

"We have also been blighted by sectarian divisions, terrible injustices, destructive violence, and by win-lose political attitudes. And for this, we have cause to lament."

Dr Yambasu said service was an opportunity to give thanks and, also, lament; to imagine what could be, and to choose the way forward that can be mutually beneficial. The service included an opening prayer in Irish led by Linda Ervine and Seán Coll.

Intercessions were offered by Prof Mary Hannon-Fletcher and Robert Barfoot, both of whom were injured in the Troubles. Children carried a lantern to the altar, a symbol of light and hope for the future.

Northern Ireland was established in May 1921 after the partition of Ireland. It followed decades of turmoil between nationalists, who wanted independence from British rule, and unionists, who wanted to remain in the United Kingdom.

The border divided the 32-county island into two separate jurisdictions - six counties in the north-east became Northern Ireland, which is still part of the UK. The other 26-county territory became the Irish Free State, but is now the Republic of Ireland.

Nationalists, north and south of the border, were infuriated by partition and continued to campaign for independence for the whole island. Many unionists were also bitterly disappointed, especially those who lived on the southern side and woke up to find themselves in a new state on 3 May 1921.