The precociously brilliant son of an officer in the army of the Austro-Hungarian Empire, Karol Wojtyla's early life was blighted by family tragedies, starting with the death of his mother when he was eight. Karol responded to the news with the words, "It was the will of God", but the loss stimulated his intense veneration for the Virgin Mary, one of the themes that came to dominate his papacy.
Death hovered close to the family: a sister had died in infancy before Karol was born, and his elder brother Edmund died when he was 11, leaving father and son the only members of the family still alive. During the war Karol himself was hit by a lorry and severely injured. His recovery after a fortnight in hospital convinced him that God had saved him for a purpose.
Wojtyla was ordained in 1946, and after study in Rome became a parish priest as his devoutly Catholic homeland fell under the tyranny of communism. Eleven years later, at the age of 38, he became the youngest bishop in Poland. Having experienced both Nazi tyranny – during the German occupation of Poland in the war, when he worked as a labourer – and communist rule, he developed the conviction that both forms of totalitarianism had emerged from the European Enlightenment.
They were twin horrors, and to Wojtyla the disasters they brought in train proved that when man claimed his independence from God, or went further and denied God's existence, he inevitably ended putting himself in the deity's place and committing evil.
These ranged from the Holocaust – which strongly affected Wojtyla, who had had close Jewish friends as a child – to the more recent phenomenon of abortion on demand, which he considered a comparable evil.
Wojtyla's rapid rise through the church's ranks continued: he was not only brilliant and devout but also a communicator of genius. He was never a sophisticated theologian – Joseph Ratzinger, now Pope Benedict XVI, was to play that role for him – and did not have the patience or application to tackle corruption in the Vatican or to reform the church's creaking machinery.
His eyes were set on higher things: in particular the restoration of the church to centre stage in his native land. After the sudden death of Pope John Paul I he was stunningly elected pope in 1978, at the age of 58 – the first Polish pope in history and one of the youngest pontiffs for centuries.
The following year he paid a triumphal return visit to Poland where he inspired the people to defy the communist authorities peacefully.
Lech Walesa, the leader of the Gdansk dockworkers' union (and later Polish president) said of him: "Before his pontificate ... nobody knew how to get rid of communism. In Warsaw in 1979 he simply said, 'Do not be afraid'."
The former Soviet leader Mikhail Gorbachev said of him: "The collapse of the Iron Curtain would have been impossible without John Paul II."