BAGHDAD - Pope Francis ended his historic tour of Iraq on Monday, departing by plane from Baghdad after visiting conflict-torn cities, meeting Muslim and Christian leaders and preaching peace and coexistence over war.

Francis waved one last time from before boarding a plane flying the Vatican and Iraqi flags from its cockpit windows. President Barham Salih accompanied the 84-year-old pontiff down a red carpet to his flight.

During Francis's trip, the first ever papal visit to Iraq, he toured four cities, including Mosul, the former Islamic State stronghold where vast areas still lie in ruins, telling Iraqis that "peace is more powerful than war."

He said Iraq would "always remain with me, in my heart".

The pontiff, who walked with a limp during parts of the frantic tour, also made a historical first in meeting Iraq's Grand Ayatollah Ali al-Sistani, Iraq's top Shi'ite Muslim cleric.

Iraqis welcomed the pope and said it was a chance for the world to see their perpetually crisis-hit nation in a new light.

Iraq suffers from chronic mismanagement and corruption, and a steady level of violence often linked to the region's U.S.-Iran rivalry 18 years after the United States invaded.

(Reporting by John Davison in Baghdad, Phil Pullella aboard the papal plane. Editing by Gerry Doyle) ((John.Davison@thomsonreuters.com;))