(CNN) -- Before he was Pope Benedict XVI, before he earned the nickname "Cardinal No" as the enforcer of church doctrine, he was Joseph Ratzinger -- the son of Maria and police officer Joseph Ratzinger, learning about life and God in Germany between two world wars.
According to Roman Catholic doctrine, Benedict is not only the church's leader but God's representative on earth and infallible.
He is also a man -- one who savors his meat and potatoes, an accomplished pianist who loves Mozart, and a teacher who for years commanded university classes. His humanity became apparent Monday, when the Vatican announced he'd resign at month's end "because of advanced age," becoming the first pope in nearly 600 years to do so.
After his birth on April 16, 1927, in Marktl am Inn, in southeastern Germany near the Austrian border, Ratzinger's early years were defined by his country and the turbulent times, as well as his faith.
Adolf Hitler rose to power during Ratzinger's adolescent years in Traunstein, in the heavily Catholic region of Bavaria. When he was 14, school officials followed Nazi officials' orders and enrolled him and the rest of his class in the Hitler Youth movement -- against his will, Ratzinger wrote in his memoir.
He left the organization shortly thereafter, because he was studying for the priesthood. But in 1943, Ratzinger was brought back into the Nazi fold upon being drafted into the German army.
For the next two years, Ratzinger served his country as part of an anti-aircraft unit. But in the waning days of World War II, he deserted -- and was taken prisoner by the U.S. Army.
According to CNN Senior Vatican Analyst John Allen, Ratzinger's family was strongly, if quietly, anti-Nazi and his father took a series of less significant jobs to steer clear from what was happening under Hitler.
In June 1945, Ratzinger was released from a POW camp. Hitching a ride on a milk truck, he headed home.
And life began anew.
The soldier became a scholar, studying philosophy and theology at the University of Munich and another school in Freising between 1946 and 1951. Two years later, he earned a doctorate in theology, after submitting a thesis titled, "The People and House of God in St. Augustine's Doctrine of the Church."
Eventually, he became a professor -- teaching dogma and fundamental theology at four German universities. In 1969, for instance, he was appointed vice president and professor of theology at the University of Regensburg in Germany.
"Books are his best friends," Allen said.
All the while, he grew more ingrained in the Roman Catholic Church and its hierarchy.
In 1962, 11 years after his ordination as a priest, the then-35-year-old was a consultant during Vatican II to Cardinal Josef Frings, a reformer who was archbishop of Cologne, Germany.
As a young priest, Ratzinger was on the progressive side of theological debates. But he began to shift right after student revolutions of 1968, according to Allen, also a correspondent with the National Catholic Reporter.
In fact, it was Ratzinger's conservative defense of strict doctrines that defined him in many people's eyes -- until he became pope.
A defender of church doctrine and a 'simple, humble worker'
In the late 1970s and 1980s, Ratzinger shot up the church's ranks.
In spring 1977, he was named archbishop of Munich and Freising. A few months later, Pope Paul VI appointed him cardinal.
One of his most significant steps up came in 1981 when he took over as head of the Congregation for the Doctrine of Faith, the Vatican office that oversees "the doctrine on the faith and morals throughout the Catholic world," according to the Vatican.
Ratzinger became known as "Cardinal No" stemming from his efforts to crack down on the liberation theology movement, religious pluralism, challenges to traditional teachings on issues such as homosexuality, and calls to ordain women as priests.
Liberation theology combined Christian theology with political activism on issues like human rights and social justice. While partially compatible with Catholic social teachings, it was rejected by the Vatican, which objected to the mixing of church theology with Marxist ideas such as class struggle.
"It (was) his job to police the doctrinal boundaries of the Roman Catholic Church, and inevitably when you do that, there are going to be hurt feelings by people who find themselves on the wrong side of those lines," said Allen, the author of "Cardinal Ratzinger: The Vatican's Enforcer of the Faith."
Over subsequent years, he made news when, for instance, he labeled homosexuality "an intrinsic moral evil" and called the Soviet Union and its communist satellite nations "a shame of our time." In the 1990s, Ratzinger openly challenged a fellow German cardinal who had encouraged divorced and civilly remarried Catholics to return to the sacraments.
Ratzinger also argued Muslim Turkey did not belong in Christian Europe and issued a document saying that Catholicism was the only true religion -- questioning the validity of other religions, even Christian ones, even as his Pope John Paul II was trying to reach out to other faiths.
Although objections came from some of his fellow cardinals, the pope did not restrain Ratzinger, in part because their friendship went back four decades, to the time when the two were young priests at the Vatican II meetings in Rome.
That bond persevered until John Paul's death in 2005, by which time Ratzinger was dean of the College of Cardinals -- the high-level group that advises the pope and, when called upon, picks a new pontiff.
In April 2005, they picked him, then 78 years old. Now called Benedict, his reputation was seen as more subdued than his predecessor. He traveled extensively, if not at John Paul's pace.
His words carried special weight, as in 2006, when he quoted from 14th-century Byzantine emperor Manuel II Paleologus saying the Muslim Prophet Mohammed had only brought into the world "things only evil and inhuman." The remarks set off protests by Muslims worldwide, and Benedict apologized for any offense taken by Muslims.
For some, the defining element of his papacy was the sex abuse scandal, with the church being accused of not doing enough to deal with reports of abuse by priests over decades, and on multiple continents.
Two years after acknowledging "shame" over the "evils" of abuse, Benedict issued a statement in 2010 saying the church had not been vigilant or fast enough in responding to the problem -- one of the most forthright admissions to date, though it still did not placate some who criticized then-Cardinal Ratzinger for not cracking down sufficiently.
Such missives demonstrated his power, in the church and on the world stage. But for all the headlines he generated, Benedict -- as he did in his first blessing after being elected pope -- insisted he was merely "a simple, humble worker in God's vineyard."
"I am consoled by the fact that the Lord knows how to work and how to act, even with insufficient tools," he said then, "and I especially trust in your prayers."