* Pope on last leg of trip to Georgia and Azerbaijan
* Francis will visit Mosque before returning to Rome
* Vatican estimates about 700 Catholics in Azerbaijan
By Philip Pullella and Nailia Bagirova
BAKU, Oct 2 (Reuters) - Pope Francis said a 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 neighbouring Georgia and returns to Rome on 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.
Last week Azeris voted in a referendum in favour of extending the presidential term from five to seven years, a step that critics say will hand unprecedented powers to Ilham Aliyev.
Aliyev, 54, can seek re-election indefinitely after a maximum number of terms in office was scrapped via a similar referendum seven years ago.
Rights advocates accuse his government of muzzling and jailing opponents but the government says citizens enjoy full freedom of speech and a lively opposition press.
The West has courted the country as an alternative to Russia in supplying oil and gas. (Additional reporting by Margarita Andtidze in Tbilisi; Editing by Christian Lowe)