Pope Francis was unhurt after he stumbled down a step on an altar while celebrating mass in the Polish city of Czeztochowa, but quickly got back to his feet and was able to continue.

The mishap took place as the pontiff visited the revered Jasna Gora monastery, which is home to the legendary Black Madonna.

Pope Francis celebrated an outdoor mass for a congregation numbering in the tens of thousands thanking Poles for holding on to their faith in difficult times.

Francis praised what he called "the contagious power of a genuine faith, passed down from family to family" in Poland.

He said their faith had stayed strong in many situations throughout history.

As the 79-year-old pope was blessing the altar at the start of the mass, he tripped on a step but was helped up by aides.

He continued the mass and read his homily normally.

The pope, whose main purpose in Poland is to preside at an international gathering of Catholic youth in Krakow, was driven to this city about 140km away instead of taking a helicopter as planned because of the possibility of bad weather.

The shrine is home to the Black Madonna, a Byzantine icon from sometime between the sixth and ninth centuries and brought to Poland some 600 years ago.

The icon is painted on wood and covered with silver and jewels.

The shrine has been a focal point in difficult periods of Polish history. Poles flocked there to pray when martial law was declared by the communist government in the early 1980s.

The late Pope John Paul II, who reigned for nearly three decades before he died in 2005, visited the shrine often during his trips to his homeland and donated the blood-stained white sash he was wearing on 13 May 1981, when he was shot in St Peter's Square at the Vatican by Turkish gunman Mehmet Ali Agca.

Francis was due to return to Krakow this afternoon for formally open World Youth Day, a jamboree of young people around the world.