Pope Francis celebrated Mass on Sunday for the miniscule Catholic community in Shi'ite Muslim Azerbaijan, urging the "precious little flock" to keep the faith and paying tribute to those persecuted during the Soviet era.
The oil and gas-rich nation of about 9 million people bordering on Russia, Iran and Turkey, has only about 700 Catholics, according to Vatican figures.
Many of them are foreigners, including staff from embassies and domestic workers and some in the oil and gas industries.
In fact, Sunday's Mass, which was said mostly in English, had more of the feeling of a worship service in a multi-ethnic, well-to-do American suburb than a liturgy on the Caspian sea.
"You are a little flock that is so precious in God's eyes," he told the congregation in the homily of the Mass in the modern church, which opened in 2007 and was built on the site of one demolished under Soviet rule in 1931.
"Courage. Go ahead without fear", Francis said, praising them for being a close-knit and vibrant "community on the periphery".
Francis, who arrived in Baku from neighboring Georgia and returns to Rome Sunday night, also paid tribute to Christians who were persecuted by the Communists.
"Here the faith, after the years of persecution, has accomplished wonders. I wish to recall the many courageous Christians who trusted in the Lord and were faithful in the face of adversity," he said.
He said he was sure "that when you look to the example of those who have gone before you in faith, you will not let your hearts become lukewarm."
The land for the modern church building was donated by the late president Heydar Aliyev at the request of the late Pope John Paul after the pontiff's visit to Baku in 2002.
Relations between the miniscule Catholic community and the Muslims in Azerbaijan are broadly smooth.
Before returning to Rome, Francis was due to meet in the afternoon with Heydar Aliyev son, Ilham Aliyev, who has ruled since his father's death in 2003, and visit a mosque.