Pope Benedict XVI has appealed to Muslims to help combat the "cruel fanaticism" of terrorism.
The Pope said the Church had good and bad elements
At a meeting with Germany's Muslim leaders in Cologne, the pontiff said Islamic teachers had a "great responsibility" to educate the young.
Afterwards, the Pope led an open-air prayer vigil at a park outside the city, which was attended by at least 700,000 people.
Pope Benedict wraps up his four-day trip to his native country on Sunday.
The meeting with some 30 Muslim leaders follows the Pope's earlier pledge to build "bridges of friendship" with other faiths.
He urged Muslims to join Christians to try to stop the spread of terrorism, which he called a "new barbarism".
The Pope spoke of past wars that had been waged between Christians and Muslims with both sides invoking God's name as if, the Pope said, killing the enemy could be pleasing to God.
The Pope said by working together, Muslims and Christians could "turn back the wave of cruel fanaticism that endangers the lives of so many people and hinders progress toward world peace".
Since the Pope's election four months ago, he has been ultra-cautious in his comments on recent acts of international terrorism such as the London bombings, says the BBC's David Willey in Cologne.
The pontiff has limited his remarks to describing the perpetrators as fanatics who do not represent the true Muslim faith, our correspondent says.
There are about 3.5m German Muslims, mainly of Turkish descent - one of the highest figures in Western Europe.
A day earlier, the Pope met German Jewish leaders during a visit to a synagogue in Cologne.
He warned of rising anti-Semitism and paid his respects to Jews murdered during the Nazi era.
It was only the second time a Pope has visited a Jewish place of worship, following Pope John Paul II's visit to a Rome synagogue in 1986.
'Much to criticise'
After meeting the Muslim leaders, the Pope attended the outdoor evening service at Marienfeld, the site of disused coal mine outside Cologne.
He told the huge crowd that there was "much that could be criticised in the Church".
"We know this and the Lord himself told us so: it is a net with good fish and bad fish," the pontiff said.
Many of the pilgrims are expected to stay the night in the open air so they can attend the Pope's morning Mass - a huge outdoor event that is being seen as the climax of his visit, which marks World Youth Day.
The World Youth Day festival, created by Pope John Paul II who died in April, is held in a different part of the world every three years.