BAGHDAD — With cheering, partially masked crowds and armed security lining the roads, Pope Francis began the first-ever papal trip to Iraq on Friday, seeking reconciliation in a country with an extraordinary biblical history, a surging coronavirus outbreak and ongoing political turmoil.

He called for cooperation among ethnic groups in the palace once used by autocrat Saddam Hussein. He called for an end to religious violence in a church where, 10 years earlier, gunmen had killed 58 people, leaving flesh on the pews.

"I come as a pilgrim of peace," Francis said.

Francis’s four-day visit is his first international trip since the start of the pandemic and marks a return to the globe-trotting diplomacy — especially to minority-Christian countries — that had been his hallmark.

Some have questioned why he is choosing to make the trip now, given the multitude of threats. Militias are competing for power and launching rocket attacks. The Islamic State has been beaten back but not fully eliminated. And coronavirus cases have climbed higher and higher over the past month, prompting the Iraqi government to impose a curfew and other restrictions, including on religious gatherings.

But in choosing to travel in the face of the risks, to a country known foremost for its war scars and suffering, Francis has reassembled some of the ingredients that years earlier made his papacy feel so novel. He is traveling at a time when other global figures are staying put, aiming to play a hand in the reconstruction of a country where decades of efforts have failed. His trip amounts to a show of encouragement for a nation trying to recover from the chaos of a U.S.-led invasion and the brutality of the Islamic State, a group that once vowed to “conquer Rome.”

Speaking briefly aboard the papal plane on the way to Baghdad, Francis called the trip “emblematic” and said he was duty-bound to visit a nation that has been “martyred for so many years.”

“I am happy to be traveling again,” the pope said.

The Vatican had said Francis’s events would include smaller crowds than usual, as a way to decrease the risk of coronavirus transmission. But several thousand people nonetheless lined highway roads hoping to get a glimpse of the pope.

In closer proximity to the pontiff, who has been vaccinated, some of the safety measures seemed lax. Unmasked singers, crowded together, greeted Francis at the airport, as did Iraqi dignitaries lining a red carpet.

In his first remarks of the trip, at Iraq’s presidential palace, Francis provided a broad view of his hopes for society trying to emerge from the coronavirus pandemic. He called not only for the equitable distribution of vaccines, but also — noting Iraq’s sectarian conflicts — said it was time for humanity to embrace “what unites us.”

“In this regard, the religious, cultural and ethnic diversity that has been a hallmark of Iraqi society for millennia is a precious resource on which to draw, not an obstacle to be eliminated,” the pope said.

Later in the day, Francis spoke to bishops and other religious figures at the Our Lady of Salvation Church, site of the 2010 attack by gunmen from an affiliate of al-Qaeda, where he said that violence was “incompatible with authentic religious teachings.”

Waiting for Francis outside that church, Haneen Imad, 25, a Christian from Baghdad, said the pope’s visit had “brought huge joy to our hearts.”

“We have suffered a lot because of the conflicts in our country, most of them religious, and we’re always in the middle,” Imad said. “For a while I felt that no one cared about us. Him visiting us and praying with us is exactly what we need. We want peace, and his visit will bring peace.”

Amid tight security, Francis is expected in the coming days to speak directly to the reeling Christian community, which has shrunk sevenfold over the past three decades, sometimes because of immediate violence, but also because hundreds of thousands have sought refuge elsewhere, with many being granted asylum in the West. 

But Francis’s most important moment is likely to come Saturday, when he meets Grand Ayatollah Ali Sistani, a preeminent figure in Shiite Islam and Iraq’s leading religious authority.

The reclusive Sistani, 90, has not left his home in the holy city of Najaf in years, so Francis will come to his doorstep. Vatican authorities have said little about the specifics of the meeting, which is expected to last about 30 minutes.

Sistani is widely seen as a moderating force in Iraq.

On Friday, the State Department warned U.S. citizens in Iraq to be alert to the possibility of attacks timed during Francis’s visit. “Attacks may occur with little or no warning, impacting airports, tourist locations, transportation hubs, markets/shopping malls, and local government facilities,” the U.S. Embassy in Baghdad said in a statement. It was unclear whether the alert was based on new information, or simply reiterating long-standing risks.

Same as Francis, the Vatican’s entourage in Baghdad has been vaccinated against the coronavirus. But some health experts have argued that the papal trip will push the risk onto crowds of people who do not have the same protections. Iraq only this week received its first modest dose of Chinese vaccines.

Mindful of the international spotlight that Francis brings with him, Iraq’s government is pulling out all the stops to ensure that the optics of his visit reflect a nation in recovery. Roads he will tour have been paved. There are roses in the streets of Baghdad.

In some cases, the pontiff’s photograph has been hung in place of the images showing slain Iranian commander Qasem Soleimani and allied Iraqi militia leader Abu Mahdi al-Muhandis — usually an ever-present visual reminder of Iraq’s position as a proxy battleground for outside powers.

Francis later in his four-day trip will also get a vivid look at the destruction wrought by the Islamic State. He will travel to territory that was once at the heart of its self-declared caliphate, visiting a mostly destroyed church that the terrorist group had used for its administration.

Davide Bernocchi, the Iraqi country representative for the Catholic Relief Services, said that as the fight against the Islamic State has subsided, a humanitarian disaster remains, with more than 1 million people still displaced. Plummeting oil prices have drained the government coffers. And the coronavirus has only amplified crushing economic problems.

“The fear is that this country has been forgotten” from the outside, Bernocchi said. “Because ISIS is no longer this military challenge. The pope coming here is a huge sign of respect from, of course, the leader of the Catholic Church, but also a global figure who is bringing the attention of the world to this country for a few days. It’s a chance for this country to feel that they are not forgotten.”

Loveluck reported from Istanbul. Mustafa Salim in Baghdad and Stefano Pitrelli in Rome contributed to this report.