SARAJEVO, Bosnia—Pope Francis pointed to Bosnia’s diverse religious heritage as a basis for lasting peace among ethnic groups still divided 20 years after the end of civil war.

The pope spoke on Saturday during a daylong visit to the Balkan country’s capital city.

At an afternoon prayer service in Sarajevo’s small Catholic cathedral, he heard...