The pope and the grand imam of al-Azhar have signed a historic declaration of fraternity, calling for peace between nations, religions and races, in front of a global audience of religious leaders from Christianity, Islam, Judaism and other faiths.

Pope Francis, the leader of the world’s Catholics, and Sheikh Ahmed al-Tayeb, the head of Sunni Islam’s most prestigious seat of learning, arrived at the ceremony in Abu Dhabi hand-in-hand in a symbol of interfaith brotherhood.

The document pledges that al-Azhar and the Vatican will work together to fight extremism. Claiming to be in the name of “all victims of wars, persecution and injustice”, it warns against a “third world war being fought piecemeal”.

It says: “We resolutely declare that religions must never incite war, hateful attitudes, hostility and extremism, nor must they incite violence or the shedding of blood.”

In the first ever papal visit to the Arabian peninsula, the birthplace of Islam, the pope specifically called for an end to wars in the Middle East, naming Yemen, Syria, Iraq and Libya. All religious leaders had a “duty to reject every nuance of approval from the word war”, he said in a 26-minute address.

The UAE is part of the Saudi-led military coalition engaged in the war in Yemen. On Sunday, before leaving Rome for Abu Dhabi, Francis said he was following the situation in Yemen “with great concern”, and that the population was “exhausted by the lengthy conflict, and a great many children are suffering from hunger”.

In his speech on Monday evening – his first public comments during the three-day trip – he welcomed “the opportunity to come here as a believer for peace ... We are here to desire peace, we are here to promote peace, to be instruments of peace.”

Violence, extremism or fanaticism could never be justified in the name of religion, he said. He also called for religious freedom “not limited only to freedom of worship”, justice and for religions to “stand on the side of the poor”.

Sheikh Tayeb, who addressed the pope as “my dear brother”, said millions of Muslims had paid the price for the actions of “a handful of criminals” following the 9/11 terrorist attacks.

The media had portrayed all Muslims as “savage barbarians” and had “installed fear in the hearts” of people in the west, he said. “All religions agree that God forbids killing.”

Earlier on Monday, Francis arrived at the lavish presidential palace in Abu Dhabi in a small black Kia. He was greeted with a 21-shot salute and military flyover trailing yellow and white smoke in the colours of the Vatican flag. Horse-mounted guards escorted the pontiff’s motorcade through the palace gardens.

The pope had a private meeting with Abu Dhabi’s crown prince, Sheikh Mohammed bin Zayed al-Nahyan, who later tweeted: “We discussed enhancing cooperation, consolidating dialogue, tolerance, human coexistence & important initiatives to achieve peace, stability and development for peoples and societies.”

The UAE is promoting itself as a regional leader in religious diversity and tolerance. According to the organisers of a conference on “human fraternity” this week, the UAE since its formation in 1971 has “given special attention to issues such as dialogue, tolerance, fraternity and peace. It also offered the world a model example of applying these human values through the coexistence and tolerance embraced by the various cultures, races and faiths living on its soil.”

The population of the Emirates is 90% expatriate, with people from more than 200 countries, including significant numbers from Asia who are employed in domestic service, hospitality and construction.

Christians are free to worship at churches and wear religious clothing. But Open Doors, which monitors discrimination against and persecution of Christians around the world, says the UAE government does not allow Christians “to evangelise or pray in public. Converts from Islam endure the most persecution as they face pressure from family members and the local community to recant their Christian faith.”

The government has also been criticised by human rights organisations for restrictions on freedom of expression.

Reem al-Hashemi, the UAE’s minister of state for international cooperation, said it was “important to note that openness has to have parameters, otherwise things can quickly spiral into incitement or hate. Freedom of expression has to have limitations.”

Pope Francis is to celebrate mass in front of an expected audience of 120,000 people at a sports stadium in Abu Dhabi on Tuesday before flying back to Rome.