Pope Francis removed his shoes as he entered the Sultan Ahmet mosque, widely known as the Blue Mosque, on Saturday.
The spiritual leader of the 1.2 billion believers claimed by the Roman Catholic Church was taken through the mosque by Istanbul's Grand Mufti Rahmi Yaran. The two paused for two minutes facing Mecca alongside each other, the pope closing his eyes, bowing his head and clasping his hands in front of the cross he wore on his chest, the cleric performing an Islamic prayer.
Vatican spokesman Reverend Federico Lombardi described the act as a "moment of silent adoration" for God. A similar act by Pope Francis' predecessor, Pope Benedict XVI, in 2006 drew criticism from some Catholics as well as Muslims.
The pope then toured the Hagia Sophia, formerly the main Byzantine church in what was Constantinople, before it was turned into a mosque after the Ottoman Turks conquered the city in 1453. Since 1935, the building has been a museum.
Particular attention has been paid to the Pope's visit to Turkey, given that the country borders Iraq and Syria where the "Islamic State" group is waging a bloody campaign of persecution against those who do not follow their radical interpretation of Sunni Islam.
Saturday's visits were conducted amid heavy security, though the pope kept with his custom of traveling in a modest vehicle.
Though Turkey is officially secular, the vast majority of its population is Muslim and its government is moderate Islamist.
The three-day papal visit to Turkey is seen as a test of Francis' ability to build bridges, as he had to establish and strengthen ties with Muslim leaders while condemning the violence against Christians and other religious minorities in the Middle East. On Friday he was received by Turkish President Recep Tayyip Erdogan at the controversial new presidential palace in Ankara.
Pope Francis is also due to meet with Patriarch Bartholomew I, the spiritual leader of the world's 300 million Orthodox Christians, as they hold talks and participate in ceremonies as part of efforts to improve relations between the two branches of Christianity, which split in 1054.
se/msh (AFP, AP, dpa, Reuters)