DHAKA, Bangladesh— After walking a political and diplomatic tightrope for most of his Nov. 26-Dec.2 visit to Myanmar and Bangladesh over the exodus of Rohingya Muslims escaping violence and persecution, Pope Francis’s final day was instead strikingly pastoral in tone.

There were no dramatic appeals to those in power, no surprise gestures such as bringing refugees home with him on the papal plane. Instead, Francis kept to the program set for most of his foreign trips, spending his last hours in Bangladesh with a local religious community, youth, and the poorest of the poor.

There was no talk of migrants and refugees, of climate change or injustice.

Instead, Saturday saw a pope who was relaxed, who ditched his prepared remarks in favor of a spontaneous conversation. A pope who allowed two girls wearing flower dresses to lead him by the hand, who took his time to greet many of the patients in the Mother Teresa Home and who was clearly feeling the joy of the hundreds of nuns, many wearing the blue-trimmed sari of the Missionaries of Charity, who almost mobbed him after waiting for hours for a chance to greet him as he passed them by on his way to the altar.

Speaking with youth, the very last appointment on his visit to Bangladesh, which is a Muslim majority country, Francis said their lives are not without direction because they have a purpose given by God, a “computer software” of sorts.

“He guides and directs us with his grace. It is as if he placed within us a computer software, which helps us to discern his divine program and, in freedom, to respond,” Francis said.

“But like all software, it too needs constantly to be updated. Keep updating your program, by listening to God and accepting the challenge of doing his will.”

The pope’s words came as he was addressing some 7,000 students gathered at Notre Dame College in Dhaka, where he received a warm welcome as he toured a sports camp where the meeting took place.

Much of his speech turned on “wisdom,” picking up on the story shared by a young man called Anthony, who said young people are growing up in a “fragile world that cries out for wisdom.”

The wisdom of God, Francis said, “opens us up to others,” to look beyond personal comforts and the “false securities which blind us to those grand ideals which make life more beautiful and worthwhile.” That wisdom, the pontiff added, teaches how to fend off a self-enclosed mentality of “my way or the highway.”

Bangladeshi Catholic nuns greet Pope Francis during his visit to Church of the Holy Rosary in Dhaka, Bangladesh, Saturday, Dec. 2, 2017. (Credit: AP Photo/Aijaz Rahi.)

“When a people, a religion or a society turns into a ‘little world,’ they lose the best that they have and plunge into a self-righteous mentality of ‘I am good and you are bad,’” he said.

As has become a tradition for Francis, he urged youth “not to spend the entire day playing with your phones,” and instead interact with their elders, searching for wisdom in the eyes. Also in keeping with past practice, Francis defined himself as a “grandfather” to the young.

The elderly, the pope told the students, carry the wisdom of experience, which can have the added value of helping avoid repeating past mistakes. They also serve as reminders that “history did not begin with us.”

Mindful of the fact that only a small percentage of the 40,000 students who benefit from Catholic education in Bangladesh are Christians, since Christians represent less than 0.5 percent of the total population of 160 million, Francis spoke to those who belong to other faiths, particularly Muslims, saying that by gathering as they did on Saturday, they showed a determination to foster “an environment of harmony, of reaching out to others, regardless of your religious differences.”

Before meeting the youth, Francis had a session with Bangladeshis in consecrated life, including a group of cloistered women. Two priests, a nun, a religious brother and a seminarian shared their experiences. Here the pope set aside his prepared remarks and speaking off-the-cuff in Spanish with an interpreter translated into English, saying that “we’re here to listen to the pope, not to get bored.”

He repeated some of his usual words on these occasions. For instance, after noting that on Friday, during an interreligious encounter someone had quoted Cardinal Jean-Lois Tauran praising Bangladesh as an example of harmony between religions, the church has to be an example of harmony within, too. There are many enemies to harmony within the Church, Francis said.

“I like to mention one, that is enough as an example,” he said, before apologizing for being repetitive about it. “The enemy of harmony in a religious community, in a presbytery, in the episcopacy, in the seminaries, is the spirit of gossip. And this is not a novelty of mine. Some 2,000 years ago, a man called St. James said in in a letter he wrote to the Church. The tongue brothers and sisters.

“An image I like to use to illustrate what the spirit of gossip is is terrorism,” he continued. “Because those who speak wrong of others, don’t do so publicly, like a terrorist doesn’t say ‘I’m a terrorist.’ Those who speak wrong of others do so in hiding. Speaks with one, throws a bomb, and leaves. And the bomb destroys as he leaves, easily, to throw another bomb.”

He also urged the religious to pray for a “spirit of joy,” saying that it produces great sadness to see priests, bishops or nuns who have a sad face, to the point that “one would like to ask them” if they had “vinegar for breakfast.

“I assure you that I feel great tenderness when I find elderly bishops, nuns or priests who’ve lived their lives to the fullest,” Francis said. “Their eyes are indescribable, of joy and peace,” with the spark of having lived with joy. This, he added, is most visible in old nuns who “spent their entire lives serving with joy and peace, they have roguish, bright eyes, full of life, because they have the wisdom of the Holy Spirit.”

Pope Francis blesses the cemetery of the historic Church of the Holy Rosary, in Dhaka, Bangladesh, Saturday, Dec. 2, 2017. (Credit: AP Photo/Andrew Medichini.)

After speaking, Francis spent a few minutes in silent prayer in the adjoining cemetery, where many religious men and women who served the local church are buried, blessing the graves and praying in silence.

Often, Francis’s final day on a trip includes a visit to those on the outskirts of society. In the Central African Republic, it was a pediatric hospital; in Colombia, an orphanage. Here, it was the “Mother Teresa House,” that tends both to orphaned children and the elderly.

The pope’s visit was a short one, and he spent his time greeting patients who’d been waiting for him in two small rooms and a group of children, elderly and infirm who were in the yard.

The home, founded in 1976, is part of a complex of the Holy Rosary Church, caring for thousands of orphaned children and people with intellectual and physical disabilities.

After wrapping his schedule, Francis was headed to the airport for his flight back to Rome, where he’s scheduled to land at 11:00 p.m. local. Once again, he’s expected to hold a press conference in-flight.

On Sunday, he’ll resume his normal activities leading the weekly Angelus prayer from a balcony in the Apostolic Palace overlooking St. Peter’s Square.