ROME (AP) — Pope Francis on Sunday became the first Catholic pontiff to visit an Anglican parish in Rome, using the historic occasion to press for greater closeness after centuries of mistrust, prejudices and hostility between the two churches.

Francis and the Anglican bishop in Europe, Robert Innes, prayed side-by-side in the All Saints Church not far from the Spanish Steps.

Innes welcomed Francis by praising the Roman Catholic leader for his solidarity with refugees and migrants.

Anglicans split from Catholicism in 1534, after England's King Henry VIII was denied a marriage annulment.

Both churches are working to develop friendly bonds despite obstacles that include deep differences on such issues as ordaining women and allowing openly gay bishops.

Tensions were aggravated when, under Francis' predecessor, Benedict XVI, the Vatican in 2009 made it easier for Anglicans unhappy about the liberal direction of their church to convert to Catholicism.

Francis in his homily acknowledged that Anglicans and Catholics had long "viewed each other with suspicion and hostility" and that there were "centuries of mutual mistrust."

"At times, progress on our journey toward full communion may seem slow and uncertain, but today we can be encouraged by our gathering," the pontiff said.

He encouraged both faiths to be "always more liberated from our respective prejudices from the past."

An Anglican parishioner told the pope that Benedict had warned about the risk, in ecumenical dialogue, of prioritizing shared social actions over seeking theological agreement. The parishioner asked Francis if it were true that he preferred working together on practical matters to holding theological discussions.

Both are important, Francis replied.

"You have to search through dialogue, through roots, through sacraments. There are things we're not in agreement on, but you cannot do this in a laboratory. You have to do this walking together," he said.

Earlier in the visit, the pope said he's studying the possibility of going to South Sudan, the East African nation suffering famine and civil war. He mentioned that Anglican, Presbyterian and Catholic bishops had asked to make the trip with Archbishop of Canterbury Justin Welby.

Like Francis, the Anglican leader has decried the suffering in South Sudan.

At the end of the largely informal gathering, one parishioner gave Francis a traditional Lenten cake, while another woman presented him with a basket of homemade marmalades and chutneys.