Pope Francis has called for an end to all forms of fundamentalism as he began a three-day visit to Turkey.
He said fighting hunger and poverty, rather than military intervention alone, were key to stopping Islamist militants carrying out "grave persecutions" in Syria and Iraq.
The Pope said "terrorist violence" showed no sign of abating in neighbouring Syria and Iraq
Islamist insurgents had declared a caliphate there and persecuted Shia Muslims, Christians and others who do not share their ultra-radical brand of Sunni Islam.
"It is licit, while always respecting international law, to stop an unjust aggressor," the leader of the world's 1.2bn Catholics said in reference to the Islamic State militants after a meeting with Turkish President Tayyip Erdogan.
"What is required is a concerted commitment on the part of all to enable resources to be directed, not to weaponry, but to the other noble battles worthy of man: the fight against hunger and sickness," he said.
Before the meeting with Mr Erdogan, the Pontiff visited the tomb of Mustafa Kemal Ataturk, who founded the modern secular Turkish state in 1923.
Pope Francis faces a delicate mission in Turkey, a majority Muslim but constitutionally secular state, in strengthening ties with religious leaders while condemning violence against Christians and other minorities in the Middle East.
He called for inter-religious dialogue "so that there will be an end of all forms of fundamentalism and terrorism that gravely demean the dignity of every man and woman and exploit religion".
Turkey has been a reluctant member of the US-led coalition against IS, refusing a frontline military role but backing the Syrian opposition and calling for President Bashar al-Assad to be toppled.
It is sheltering nearly two million refugees from Syria, thousands of Christians among them.
Turkey's Christian population has dwindled over the past century and minority groups fear Mr Erdogan's roots in Islamist politics mean it is moving in an ever less tolerant direction.
"It is essential that all citizens - Muslim, Jewish and Christian - both in the provision and practice of the law, enjoy the same rights and respect the same duties," Pope Francis said.
He will travel to Istanbul tomorrow and meet Ecumenical Patriarch Bartholomew, spiritual head of 300m Orthodox Christians worldwide, as part of an effort to forge closer ties between the ancient western and eastern wings of Christianity.
Bartholomew's seat remains in Istanbul, a vestige of the Byzantine Empire, even as his flock in Turkey has dwindled to fewer than 3,000 among a population of 75m Muslims.
Syria's total Christian minority made up around 10% of the population of 22m before its civil war began in 2011, while Iraq's Christian population has fallen by nearly 70pc since the start of its 2003 war.
The Turkey trip is the third by Pope Francis to a mainly Muslim nation, after Jordan and Albania.