As for his road to the Vatican, Ratzinger started seminary studies in 1939 at the age of 12. In his memoirs, he wrote of being enrolled in Hitler's Nazi youth movement against his will when he was 14 in 1941, when membership was compulsory. In 1943, he was drafted into a Nazi anti-aircraft unit in Munich. He says he was soon let out because he was a priest in training. He returned home only to find an army draft notice waiting for him in the fall of 1944.
As World War II came to an end, the 18-year-old Ratzinger deserted the army. In May 1945, U.S. troops arrived in his town and he was sent to a prisoner-of-war camp.
In his memoir, he says that he became convinced God "wanted something from me, something which could only be accomplished by becoming a priest."
"I was shy and unpractical, had no talent for sports or organization or administration," he wrote. "I had to ask myself if I would ever be able to connect with people."
Ratzinger later recalled that during this dark time the church served as "a citadel of truth and righteousness against the realm of atheism and deceit."
After the war, Ratzinger returned to the seminary where he was known to play Mozart on the piano. He and his older brother, Georg, were ordained priests June 29, 1951. Three years later, he received his doctorate in theology from the University of Munich and began teaching in Bonn, the first of several appointments in German universities.
Chosen as an adviser to the Second Vatican Council in 1962, when the church became more open under Pope John XXIII, Ratzinger was a progressive voice in updating church laws on heresy.
Hans Kung, the Swiss theologian, was so impressed by Ratzinger's intellect that in 1966 he brought him on as staff at the University of Tubingen, without interviewing other candidates, a practice unheard of in German universities.
But the radicalism he encountered there bothered him. He opposed the 1968 Marxist student demonstrations and left the university for his native Bavaria to teach at a more conservative university.
"I had the feeling that to be faithful to my faith I must also be in opposition to interpretations of the faith that are not interpretations but oppositions," he later said.
It was during the 1970s that Ratzinger explored his deepest theological thoughts.
In 1977, Ratzinger was appointed bishop of Munich and elevated to cardinal three months later by Pope Paul VI. He was one of only two cardinals in the latest conclave who were not chosen by John Paul II.
That same year he was appointed to the Synod of Bishops, an advisory council to the pope, and met the archbishop of Krakow, Karol Cardinal Wojtyla, the future Pope John Paul II.
They found they were both intellectual, multilingual church men despite their different styles: a soft-spoken, polite Bavarian vs. the athletic, media loving anti-Communist Pole.
When Wojtyla was elected pope in 1978, he invited Ratzinger to Rome.
After overcoming Ratzinger's objections, John Paul named him to head the Congregation for the Doctrine of the Faith as guardian of church dogma.
A Vatican spokesman acknowledged that some papal appointments were influenced by politics but Ratzinger was "one of the most personal choices" of John Paul's pontificate.
Ratzinger later became the Vatican official responsible for reigning in dissident clergymen like his old mentor Kung, whose license to teach theology was revoked by the Vatican in 1979.
He explained that during Vatican II he began to have second thoughts about the new direction the clergy was taking.
"I found the mood in the church and among theologians to be agitated," he wrote. "More and more there was the impression that nothing stood fast in the church, that everything was up for revision."
A conservative on issues such as homosexuality and the ordination of women, Benedict also denounced rock music, dismissed anyone who tried to find "feminist" meanings in the Bible, and denied Communion to those who supported abortion and euthanasia.