Improving relations with other religions has been a priority for the Argentine pontiff
Pope Francis arrives in Morocco on Saturday for a visit which will see him meet Muslim leaders and migrants ahead of a mass with the country's minority Catholic community.
The spiritual leader of the world's 1.3 billion Catholics was invited by King Mohammed VI as part of the "development of interreligious dialogue", according to Moroccan authorities.
Improving relations with other religions has been a priority for the Argentine pontiff, whose papacy has been marred by a wave of child sex abuse allegations against clergy.
The Moroccan capital Rabat has stepped up security ahead of his arrival.
Buildings have been repainted, streets decorated and lawns manicured ahead of the first papal visit to Morocco since John Paul II in 1985.
Francis is due to be welcomed at the airport by the king and presented with dates and almond milk. Then the pontiff will step into his Popemobile and the monarch into a limousine.
They will drive to a welcome ceremony at a mosque and a mausoleum, attended by 25,000 and beamed onto giant screens, before the king hosts Francis at the royal palace.
The monarch is known as the "commander of the faithful" in Morocco, where 99% of the population is Muslim.
Francis will also visit an institute where around 1,300 students are studying to become imams and preachers, teaching "moderate Islam" and backed by the king.
"It's a very significant event, the first time that a pope is welcomed to an institute for the training of imams," said Vatican spokesman Alessandro Gisotti.
During the visit, Francis is due to hear from two students -- one African and one European -- as well as a statement by Morocco's Ministry of Islamic Affairs.
A concert drawing inspiration from Islam, Christianity and Judaism is also on the agenda.
Last month Francis visited the United Arab Emirates, where he met with Sheikh Ahmed al-Tayeb, the imam of Cairo's Al-Azhar, Sunni Islam's prestigious seat of learning.
The two signed a document on "human fraternity for world peace", which among other things called for "freedom of belief" and "full citizenship" rights for minorities.
Francis will not hesitate to refer to the text, which from now on he will give to all heads of state, Gisotti said.
In Morocco, where Islam is the state religion, authorities are keen to stress the country's "religious tolerance" which allows Christians and Jews to worship freely.
But Moroccans are automatically considered Muslim if they are not born into the Jewish community, apostasy is socially frowned upon, and proselytizing is criminalized.
Those who try to "rock the faith of a Muslim or to convert him to another religion" risk a prison term of up to three years.
After years in the shadows, since 2017 the small number of converts has called openly for the right to live "without persecution" and "without discrimination".
Around 30,000 to 35,000 Catholics live in Morocco, many of them from sub-Saharan Africa.
The pope is due to finish his Saturday schedule by meeting migrants at a centre run by Catholic humanitarian organization Caritas.
The charity runs day centres for migrants who are trying to reach Europe across the Mediterranean, as well as supporting their access to services.
The number of people taking the sea route from Morocco to Spain has increased recently due to the closure of the border with Libya.
In 2017, Caritas centres in Rabat, Casablanca and Tangier welcomed 7,551 new arrivals, according to the charity.
Rabat claims to have a "humanistic" approach to migration and rejects allegations by rights groups of "brutal arrest campaigns" and "forced displacement" to the country's southern border.
Francis has throughout his papacy highlighted the plight of migrants and refugees, calling on Catholics as well as politicians to show solidarity with those in need.
On Sunday, the pope will celebrate mass at a Rabat stadium with an estimated 10,000 people attending.