President Obama and Russian President Vladimir Putin, left, take their seats at the opening session of the Asia-Pacific Economic Cooperation in Lima, Peru. (Pablo Martinez Monsivais/Associated Press)

LIMA, Peru — President Obama spent the last day of his final foreign trip attempting to make headway on one of the most painful aspects of his foreign policy portfolio: the civil war in Syria.

Just before the Asia-Pacific Economic Cooperation summit opened its first formal session here in the Peruvian capital on Sunday, Obama spoke briefly with Russian President Vladimir Putin, who was standing by his seat at a massive circular table around which the participants were arrayed.

The four-minute discussion, which a White House official described as “brief and informal,” represented the first time the leaders had spoken in person since the Group of 20 convened in China in September.

Despite the short duration of the discussion, Obama and Putin delved into topics that included their disagreements over Ukraine and Russia’s support for the Syrian government in the civil war, where the rebel-held enclave of eastern Aleppo has been under daily aerial assault for nearly a week. On Saturday, Syrian airstrikes there killed at least 20 people; meanwhile, Russia announced that day that it was launching an offensive in the northern rebel-controlled Idlib province and in central Homs province.

“Beyond pleasantries, the president urged President Putin to uphold Russia's commitments under the Minsk agreements, underscoring the U.S. and our partners' commitment to Ukraine's sovereignty,” said the official, who spoke on the condition of anonymity to discuss diplomatic matters and was referring to a peace deal signed in Minsk, the capital of Belarus, to end the crisis in Ukraine.

“On Syria, the president noted the need for Secretary [John] Kerry and Foreign Minister [Sergei] Lavrov to continue pursuing initiatives, together with the broader international community, to diminish the violence and alleviate the suffering of the Syrian people.”

Dmitry Peskov, a Putin spokesman, said in a statement reported by the news agency Interfax, “The presidents expressed regret that it was not possible to make progress in Ukraine, however, it was pointed out that the remaining two months [before Obama's term ends] should be used for the continuation of the search for a Syrian settlement. In this context, they agreed that Lavrov and Kerry will continue contacts.”

But there is little prospect that much will change even though Obama and his top aides have been sharply critical of Russia’s support for Syrian President Bashar al-Assad and the atrocities his government has carried out in rebel-held eastern Aleppo, where about 275,000 people remain.

“Putin no longer has a reason to negotiate with president Obama and instead will look for better terms on Syria from President Trump,” Ilan Goldenberg, who directs the Middle East Security program at the Center for a New American Security, said in an email. “For the next two months the Russians will ignore American and international entreaties and work with Assad and the Iranians to do all they can to pulverize Aleppo and destroy the Syrian opposition.”

On Saturday, national security adviser Susan E. Rice condemned the destruction of the remaining hospitals in eastern Aleppo, as well as several first-responder staging locations, by Assad loyalists.

“There is no excuse for these heinous actions,” Rice said in a statement. “For years, the United States has worked with our international partners to support their relief efforts and provide humanitarian aid to the Syrian people suffering as a direct result of Assad's war against his own people, which Moscow has aided and abetted. The Syrian regime and its allies, Russia in particular, bear responsibly for the immediate and long-term consequences these actions have caused in Syria and beyond.”

Goldenberg said that while Putin is likely to lobby President-elect Donald Trump to accept the idea that Assad should stay in power, the problem remains that the alliance of Russia, Syria and Iran “does not have the ground power to retake and hold all of the necessary territory in Northwest Syria. Instead they will destroy what is left of the acceptable opposition and drive it into the hands of extremists.”

In addition to his informal talks with Putin, Obama met one-on-one with Australian Prime Minister Malcolm Turnbull and Canadian Prime Minister Justin Trudeau.

After meeting with Turnbull, Obama said he had conveyed his confidence that there would be “a strong handoff and continuity in the next administration.”

Turnbull emphasized the views Obama and he share, noting that “on trade we are quite of the same mind, on the importance of open markets.” He added, looking at Obama, “We want America to succeed under the next president, just as it has succeeded under your leadership.” Obama's term ends in January, and his successor, Trump, had promised on the campaign trail that he would rip up U.S. trade deals.