Pope Benedict XVI addressed Germany's parliament from the historic Reichstag building, warning that politicians must not sacrifice ethics for power and evoking the Nazi excesses of his homeland as a lesson in history.
Amid scattered protests outside and a boycott by some lawmakers, Benedict began his first state visit to Germany in a bid to stem the tide of Catholics leaving the church while acknowledging the damage caused by the clerical sex abuse scandal.
The pope spoke for 20 minutes in the Reichstag, which was torched in 1933 in an incident used by Hitler to strengthen his grip on power.
"We Germans know from our own experience" what happens when power is corrupted, Benedict said, describing Nazis as a "highly organized band of robbers, capable of threatening the whole world and driving it to the edge of the abyss."
But he said even under the Nazi dictatorship resistance movements stuck to their beliefs at a great risk, "thereby doing a great service to justice and to humanity as a whole."
He also urged all Germans not to ignore religion.
"Even today, there is ultimately nothing else we could wish for but a listening heart — the capacity to discern between good and evil, and thus to establish true law, to serve justice and peace," he said.
The Bavarian-born pontiff was met on a red carpet at Berlin's Tegel airport by German Chancellor Angela Merkel and President Christian Wulff at the start of his four-day visit. He greeted members of the German Catholic Church, and children waiting with small yellow-and-white Vatican flags presented him with a bouquet.
About 20 protesters stood outside the airport, holding banners with slogans like "Against anti-Semitism, sexism and homophobia" and "My body, my choice."
The Vatican's views on contraception, the role of women, homosexuality and its handling of the sexual abuse scandal that rocked Germany last year are seen by many in Germany as outdated.
About 100 lawmakers from opposition parties boycotted the pope's appearance, claiming it violated the church-state separation. But Benedict looked out on a mostly full house as guests occupied the empty seats and finished his speech to a standing ovation.
Police estimated that only "several thousand" protesters ended up showing up at the capital's Potsdamer Platz, far fewer than organizers had predicted. Some 6,000 officers were on hand throughout the city.
Benedict, who has long favored environmental causes, also voiced strong support for Germany's ecological movement, calling it "a cry for fresh air which must not be ignored or pushed aside."
In a rally during the pope's speech, protesters held signs with slogans like "Not welcome" and "Where there's enlightenment, there's future."
"Today is a good day to be visible," Maria Pflugradt, a 22-year-old student from Cottbus told The Associated Press. "Not only because he is against homosexuals, but also because the church has made far too many mistakes in the last centuries and I think the government and politics should not be so close to him."
In parliament, Speaker Norbert Lammert welcomed the pope, noting that the last time there was a pontiff of German origin Germany didn't yet even exist as a state.
"Germany is a country that over centuries was strongly marked by religion and religious wars," Lammert said. "A country whose Christian traditions of belief also influence the constitution we have today."
But flagging Christian influence in Europe was one of the themes of Benedict, who has often lamented that the continent is ignoring its Christian roots.
"We are witnessing a growing indifference to religion in society," he said at a formal welcoming ceremony at the German president's Bellevue palace. He called religion a foundation for a successful society and said its values were essential for freedom.
Benedict said the presidential palace, which was destroyed in World War II, was a reminder of German history.
"A clear look at the past, even at its dark pages, enables us to learn from it and to receive an impetus for the present," the pope said.
Over the next four days, the pope has meetings with leaders of Germany's Jewish and Muslim communities, three Masses, an ecumenical service with Lutheran church members and other meetings, and possibly meetings with victims abused by priests.
More than 250,000 people are registered attend his Masses, starting with an open-air service Thursday night in Berlin's Olympic Stadium.
Benedict was not expected to meet with German Roman Catholic dissidents who have called for allowing women priests and ending mandatory celibacy for priests.
He told reporters on the plane the church needs to examine why people have been leaving recently and the part that the cleric abuse scandals have played in that.
"I can understand that some people have been scandalized by the crimes that have been revealed in recent times," he said. "(There are both) good and bad fish in the Lord's net."
The German president, himself Catholic, warmly welcomed the pope and praised the role played by the Church in supporting German reunification more than 20 years ago. But, at the same time, Wulff clearly expressed his understanding of why many Germans can no longer relate to a church.
"It is important for the Church to remain close to the people and not to turn inward on itself," Wulff said.
The president also noted that as a remarried divorcee, he is not allowed to accept communion.
"Many ask themselves how mercifully it treats people who have suffered breakups in their own lives," Wulff said.
Vatican spokesman the Rev. Federico Lombardi called the president's remarks "beautiful and very sincere."