Sarajevo, Bosnia (CNN) Pope Francis brought a message of peace and reconciliation as he visited the Bosnian capital of Sarajevo on Saturday, in his latest trip to a country with a large Muslim population.

The daylong visit included a meeting with the members of the Bosnia-Herzegovina presidency at the presidential palace, and an open-air Mass at a stadium which tens of thousands of joyful worshipers attended.

Bosnia has faced past tensions among Muslims, Catholics and Orthodox Christians. Two decades ago, ethnic and religious hatred raged during the nearly four-year siege of Sarajevo in the 1990s. Up to 150,000 are estimated to have died in the war, many of them in ethnic cleansing, a term first coined in the Bosnian conflict.

The Pope was greeted with cheers and applause as he moved through the crowds at the stadium in an open-sided "popemobile" ahead of the Mass.

In his homily, he spoke of the suffering, misery and destruction brought by war -- and urged all those there to work toward peace, despite the efforts of those who seek to foster conflict for their own gains.

"Even in our time, the desire for peace and the commitment to build peace collide against the reality of many armed conflicts presently affecting our world," he said.

"They are a kind of third world war being fought piecemeal and, in the context of global communications, we sense an atmosphere of war."

The people of Sarajevo know well what pain war can bring, he said. "Today, dear brothers and sisters, the cry of God's people goes up once again from this city, the cry of all men and women of good will: war never again!"

'The Jerusalem of Europe'

Pope Francis lunched with Bosnia's bishops before traveling on in the popemobile, through streets lined with waving and cheering supporters, to the capital's imposing Sacred Heart Cathedral.

There he was greeted by the archbishop for Sarajevo, Cardinal Vinko Puljic, and other Roman Catholic figures, before hearing accounts of wartime suffering from a priest and members of religious orders.

At the cathedral, Pope Francis abandoned his prepared speech and spoke of the importance of remembering the country's suffering to forge a lasting peace. He talked about forgiveness and the lessons of history.

"You have no right to forget your story," he said. "Do not take revenge, but make peace."

After two priests and a nun recalled the torture and abuses suffered in the war, Pope Francis urged the gathered priests and nuns to never lose sight of the cruelty of those years.

"In your blood, in your vocation, there is the blood of these three martyrs," he said. "Think of how much they suffered."

Later, the Pope attended an interfaith gathering at the International Student Center in Sarajevo that he called a "sign of a common desire for fraternity and peace."

A city that was once a symbol of war and destruction has become a place where diversity no longer represents a menace but a sign of richness and opportunity, Pope Francis said.

Addressing political leaders at the presidential palace earlier, ahead of the Mass, Francis recognized the capital's difficult journey toward peace.

Photos: Pope Francis Photos: Pope Francis Colombian President Juan Manuel Santos, left, reads aloud words engraved on a pen as he meets with Pope Francis at the Vatican, Friday, December 16, 2016. The words "The bullets have written our past, education will write our future" are engraved on the pen, made from a recycled bullet once used in the civil war between the Colombian government and the Revolutionary Armed Forces of Colombia (FARC). The pen was later used to sign the peace agreements between the parties earlier this year. Santos, who was awarded the 2016 Nobel Peace Prize for his efforts to end the region's longest-running conflict, presented Pope Francis with the pen. Hide Caption 1 of 44 Photos: Pope Francis Pope Francis accepts a letter from a child he visited at a pediatric hospital in Rome on Thursday, December 15, 2016. Hide Caption 2 of 44 Photos: Pope Francis Pope Francis poses with members of the International Catholic Rural Association at the Vatican on Saturday, December 10, 2016. Hide Caption 3 of 44 Photos: Pope Francis Pope Francis salutes the faithful upon his arrival in St. Peter's Square at the Vatican for the Special Jubilee Papal Audience on Saturday, October 22, 2016. Hide Caption 4 of 44 Photos: Pope Francis Pope Francis looks on with joy as he releases a dove as a symbol of peace during a meeting with the Assyrian Chaldean community at the Catholic Chaldean Church of St. Simon Bar Sabbae in Tbilisi, Georgia, on September 30, 2016. Hide Caption 5 of 44 Photos: Pope Francis Pope Francis passes the main entrance to Auschwitz-Birkenau, the former concentration camp in Poland, on Friday, July 29, 2016. The Pope was there to pay tribute to those who died in the Holocaust. Hide Caption 6 of 44 Photos: Pope Francis Pope Francis looks on as Catholicos of All Armenians Karekin II celebrates the Divine Liturgy at the Apostolic Cathedral in Etchmiadzin, outside Yerevan, Armenia, on June 26, 2016. Hide Caption 7 of 44 Photos: Pope Francis Pope Francis arrives to celebrate an extraordinary Jubilee Audience as part of ongoing celebrations of the Holy Year of Mercy in St. Peter's Square in Vatican City on May 14, 2016. Hide Caption 8 of 44 Photos: Pope Francis Pope Francis hugs a child at the Moria refugee camp on the Greek island of Lesbos on Saturday, April 16, 2016. Pope Francis received an emotional welcome on the island during a visit showing solidarity with migrants fleeing war and poverty. Hide Caption 9 of 44 Photos: Pope Francis Pope Francis confesses in St. Peter's Basilica during the Vatican's Penitential Celebration on Friday, March 4, 2016. Hide Caption 10 of 44 Photos: Pope Francis Pope Francis tries on a traditional sombrero he received as a gift from a Mexican journalist on Friday, February 12, 2016, aboard a flight from Rome to Havana, Cuba. The voyage kicked off his weeklong trip to Mexico. With his penchant for crowd-pleasing and spontaneous acts of compassion, Pope Francis has earned high praise from fellow Catholics and others since he succeeded Pope Benedict XVI in March 2013. Hide Caption 11 of 44 Photos: Pope Francis Pope Francis arrives for his visit with prisoners in Santa Cruz, Bolivia, on Friday, July 10, 2015. The Pope emphasized the plight of the poor during his eight-day tour of South America, which also included stops in Ecuador and Paraguay. Hide Caption 12 of 44 Photos: Pope Francis Bolivian President Evo Morales presents the Pope with a gift of a crucifix carved into a wooden hammer and sickle -- the Communist symbol uniting laborers and peasants -- in La Paz, Bolivia, on Wednesday, July 8, 2015. Hide Caption 13 of 44 Photos: Pope Francis Pope Francis greets a crowd of Italian Catholic boy scouts and girl guides at St. Peter's Square on Saturday, June 13, 2015. Hide Caption 14 of 44 Photos: Pope Francis Russian President Vladimir Putin, left, meets Pope Francis at the Vatican on Wednesday, June 10, 2015. The Pope gave Putin a medallion depicting the angel of peace, Vatican spokesman Federico Lombardi said. The Vatican called it "an invitation to build a world of solidarity and peace founded on justice." Lombardi said the pontiff and President talked for 50 minutes about the crisis in Ukraine and violence in Iraq and Syria. Hide Caption 15 of 44 Photos: Pope Francis Pope Francis meets with Cuban President Raul Castro at the Vatican on Sunday, May 10, 2015. Castro thanked the Pope for his role in brokering the rapprochement between Havana and Washington. Hide Caption 16 of 44 Photos: Pope Francis The Pope prays face down on the floor of St. Peter's Basilica during Good Friday celebrations at the Vatican on Friday, April 3, 2015. Hide Caption 17 of 44 Photos: Pope Francis Pope Francis touches a child's face as he arrives for a meeting at the Vatican on Friday, March 6, 2015. Hide Caption 18 of 44 Photos: Pope Francis Hindu priest Kurukkal SivaSri T. Mahadeva presents a shawl to Pope Francis in Colombo, Sri Lanka, on Tuesday, January 13, 2015. Hide Caption 19 of 44 Photos: Pope Francis The Pope attends Christmas Eve Mass at St. Peter's Basilica in Vatican City in December 2014. Hide Caption 20 of 44 Photos: Pope Francis Pope Francis and Ecumenical Patriarch Bartholomew I address the faithful in Istanbul on Sunday, November 30, 2014. Hide Caption 21 of 44 Photos: Pope Francis Pope Francis speaks during the feast-day Mass while on a one-day trip to Italy's Calabria region in June 2014. The Pope spoke out against the Mafia's "adoration of evil and contempt for the common good," and declared that "Mafiosi are excommunicated, not in communion with God." Hide Caption 22 of 44 Photos: Pope Francis Pope Francis prays next to a rabbi at the Western Wall in Jerusalem's Old City in May 2014. The Pope went on a three-day trip to the Holy Land , and he was accompanied by Jewish and Muslim leaders from his home country of Argentina. Hide Caption 23 of 44 Photos: Pope Francis The Pope meets the faithful as he visits the Roman Parish of San Gregorio Magno in April 2014. Hide Caption 24 of 44 Photos: Pope Francis Queen Elizabeth II and Prince Philip, Duke of Edinburgh, have an audience with the Pope during their one-day visit to Rome in April 2014. Hide Caption 25 of 44 Photos: Pope Francis Francis speaks with US President Barack Obama at the Vatican in March 2014. Hide Caption 26 of 44 Photos: Pope Francis The Pope blesses the altar at Rome's Basilica of Santa Sabina as he celebrates Mass on Ash Wednesday in March 2014. Hide Caption 27 of 44 Photos: Pope Francis Daniele De Sanctis, a 19-month-old dressed as the pope, is handed to Francis as the pontiff is driven through the crowd in St. Peter's Square in February 2014. Hide Caption 28 of 44 Photos: Pope Francis Wind blows the papal skullcap off Pope Francis' head in February 2014. Hide Caption 29 of 44 Photos: Pope Francis A lamb is placed around Francis' neck in January 2014 as he visits a living nativity scene staged at a church on the outskirts of Rome. Hide Caption 30 of 44 Photos: Pope Francis Pope Francis meets with Pope Emeritus Benedict XVI at the Vatican in December 2013. Benedict surprised the world by resigning "because of advanced age." It was the first time a pope has stepped down in nearly 600 years. Hide Caption 31 of 44 Photos: Pope Francis Pope Francis marked his 77th birthday in December 2013 by hosting homeless men at a Mass and a meal at the Vatican. One of the men brought his dog. Hide Caption 32 of 44 Photos: Pope Francis Pope Francis embraced Vinicio Riva, a disfigured man who suffers from a non-infectious genetic disease, during a public audience at the Vatican in November 2013. Riva then buried his head in the Pope's chest. Hide Caption 33 of 44 Photos: Pope Francis Pope Francis jokes in November 2013 with members of the Rainbow Association Marco Iagulli Onlus, which uses clown therapy in hospitals, nursing homes and orphanages. Hide Caption 34 of 44 Photos: Pope Francis A young boy hugs Francis as he delivers a speech in St. Peter's Square in October 2013. The boy, part of a group of children sitting around the stage, played around the Pope as the Pope continued his speech and occasionally patted the boy's head. Hide Caption 35 of 44 Photos: Pope Francis Francis has eschewed fancy cars. Here, Father Don Renzo Zocca, second from right, offers his white Renault 4L to the Pope during a meeting at the Vatican in September 2013. Hide Caption 36 of 44 Photos: Pope Francis Francis has his picture taken inside St. Peter's Basilica with youths who came to Rome for a pilgrimage in August 2013. Hide Caption 37 of 44 Photos: Pope Francis During an impromptu news conference in July 2013, while on a plane from Brazil to Rome, the Pope said about gay priests, "Who am I to judge?" Many saw the move as the opening of a more tolerant era in the Catholic Church. Hide Caption 38 of 44 Photos: Pope Francis Crowds swarm the Pope as he makes his way through World Youth Day in Rio de Janeiro in July 2013. According to the Vatican, 1 million people turned out to see the Pope. Hide Caption 39 of 44 Photos: Pope Francis Francis frees a dove in May 2013 during his weekly general audience in St. Peter's Square. Hide Caption 40 of 44 Photos: Pope Francis Francis embraces a young boy with cerebral palsy in March 2013 -- a gesture that many took as a heartwarming token of the Pope's self-stated desire to "be close to the people." Hide Caption 41 of 44 Photos: Pope Francis The Pope washes the feet of juvenile offenders, including Muslim women, as part of Holy Thursday rituals in March 2013. The act commemorates Jesus' washing of the Apostles' feet during the Last Supper. Hide Caption 42 of 44 Photos: Pope Francis Francis stands at the reception desk of the Domus Internationalis Paulus VI residence on March 14, 2013, where he paid the bill for his stay during the conclave that would elect him leader of the world's 1.2 billion Catholics. Hide Caption 43 of 44 Photos: Pope Francis Francis, formerly known as Argentine Cardinal Jorge Mario Bergoglio, was elected the Roman Catholic Church's 266th Pope in March 2013. The first pontiff from Latin America was also the first to take the name Francis. Hide Caption 44 of 44

"I am pleased to be in this city which, although it has suffered so much in the bloody conflicts of the past century, has once again become a place of dialogue and peaceful coexistence," he said.

He highlighted the mix of distinct religious, ethnic and cultural groups that have led some to call Sarajevo "The Jerusalem of Europe," saying it "represents a crossroads of cultures, nations and religions, a status which requires the building of new bridges, while maintaining and restoring older ones."

And he said steps to extend peace and good relations among Croats, Serbs and Bosnians, as well as Muslims, Hebrews and Christians, took on a significance beyond the country's borders.

"These initiatives offer a witness to the entire world that such cooperation among varying ethnic groups and religions in view of the common good is possible; that a plurality of cultures and traditions can coexist and give rise to original and effective solutions to problems; that even the deepest wounds can be healed by purifying memories and firmly anchoring hopes in the future," he said.

Tight security

During his visit, the Pope will drive through a historic center that includes cemeteries for some of the victims of the conflict. He'll also meet youth from across all religions and leaders of Muslim, Christian Orthodox and Catholic faiths.

Pope Francis gives his blessing to thousands upon his arrival in Sarajevo.

Many will hope that in his meeting with political leaders, Francis was able to send the message that for the country to move forward, issues of corruption and high unemployment must be tackled.

Security was tight in Sarajevo ahead of his arrival, with a heightened police presence. Roads were closed and cars cleared from the streets along the pope's route.

The estimated tens of thousands who gathered for the Mass at the Kosevo Stadium also went through security screening including bag checks.

Security concerns have been heightened since a police officer was killed in April in the town of Zvornik, in what authorities said was a suspected terrorist attack

Following in John Paul II's footsteps

This is not the first time a head of the Roman Catholic Church has made a stop in Bosnia.

Pope John Paul II visited Sarajevo in 1997 in a trip that made headlines long before his plane landed.

Shortly before the Pope arrived , police found mines, plastic explosives and detonators under a bridge on which John Paul's motorcade was to pass on its way from the airport. Authorities removed them before his arrival.

He also traveled just over a year ago to Jerusalem, Tel Aviv and the West Bank city of Bethlehem, where he met with Israeli and Palestinian political leaders, as well as top religious figures.