President Trump met privately with President Volodymyr Zelensky of Ukraine on Saturday in Rome, the White House said, on the sidelines of the funeral service for Pope Francis. It was the first time the two leaders had met in person since their televised argument in late February in the Oval Office that resulted in a deep breach between the two countries.

The White House did not say when the two men met, but it appears likely it was before the funeral started, before the president left for the funeral services a little after 9 a.m. in Rome. A White House spokesman, Stephen Cheung, called it a “very productive discussion,” but gave no details.

The meeting in Rome came at a critical moment, just as the United States had presented a suggested plan for a cease-fire in Ukraine’s war with Russia and a postwar plan that would give Russia effective control over all of the lands it has illegally seized since the invasion began three years ago. The plan includes a major reversal of American policy: a formal American recognition that Crimea is Russian territory, even if Ukraine and the rest of Europe maintain that it remains part of Ukraine.

Mr. Trump had made clear he wanted his first trip overseas in this term to be to the Middle East, starting with Saudi Arabia, the site of his initial visit during his first term in office.

But then Pope Francis died. And so Saturday morning, made his way to Vatican City to pay his respects at the pontiff’s funeral.

As the ceremonies began, Mr. Trump was surrounded by European leaders he has been denouncing as freeloaders unwilling to pay their share of the continent’s defense, and leaders of the European Union, which he said was “formed in order to screw the United States.”

On his way over to Italy on Friday, Mr. Trump told reporters on Air Force One that he was attending the funeral “out of respect” for Francis, noting, “I won the Catholic vote.”

The president’s schedule does not allow much time for meetings, or even many casual “pull asides,” the term diplomats use for planned, brief encounters. Mr. Trump was able to chat a bit when he arrived.

The seating plan released by the Vatican had guests seated in their group in alphabetical order based on their country’s name in French. That put Mr. Trump in the front row between the leaders of Finland and Estonia, and just down from President Emmanuel Macron of France.

The schedule calls for Mr. Trump to leave Rome less than three hours after the ceremony begins, and to fly to Newark to spend the night at his nearby golf club.

Mr. Trump’s every handshake and conversation at the funeral is being watched for meaning. Ursula von der Leyen, the president of the European Commission, the executive arm of the European Union, was sitting a few chairs down from Mr. Trump, and White House reporters traveling with the president, but kept at a considerable distance, reported that the two appeared to chat, funereal protocols aside. In the past three months, Ms. von der Leyen was conspicuously absent from the leaders visiting the White House.