Syrian protesters waving Iranian, Russian and Syrian flags during a demonstration against American-led air strikes in Damascus in April.

WASHINGTON — Despite political tensions between the United States and Russia, the two nations’ militaries are cooperating closely — particularly in Syria, President Trump and President Vladimir V. Putin said on Monday.

But their record of collaboration — or at least efforts to avoid conflict — in the war in Syria is far more mixed.

After his meeting with Mr. Trump in Helsinki, Finland, Mr. Putin said in a joint news conference that military cooperation in Syria could be “the first showcase example of the successful joint work” between the two Cold War rivals. He noted that communication channels between the two countries’ militaries have been able to “avoid dangerous incidents and unintentional collisions in the air and in the ground.”

“Our militaries do get along very well, and they do coordinate in Syria and other places,” Mr. Trump chimed in. “Our militaries actually have gotten along probably better than our political leaders, for years.”

Yet it is not clear what room there is for close ties in Syria — other than preventing clashes on the ground or crashes in the sky — given Russia’s backing of the government of President Bashar al-Assad of Syria and the United States’ support for rebel factions.

Russian mercenaries have battled American commandos and their Syrian Kurdish allies. Russian and American warplanes have nearly collided.

Here are five areas where the American and Russian militaries have crossed paths in Syria over the last year.

The generals

The two nations’ top military officers, Gen. Joseph F. Dunford Jr., the chairman of the Joint Chiefs of Staff, and Gen. Valery V. Gerasimov, Russia’s chief of the general staff, meet occasionally. They talk more frequently — mainly to help prevent the two militaries from jousting in increasingly close quarters in Syria.

Gen. Valery V. Gerasimov, left, Russia’s chief of the general staff, across from Gen. Joseph F. Dunford Jr., the chairman of the Joint Chiefs of Staff, at meeting in Helsinki, Finland, last month. The two meet occasionally and talk more frequently to head off potential conflicts between their two militaries in Syria.

The generals met on June 8 in Helsinki to discuss Syria, security in Europe and overall United States-Russia military relations, General Dunford’s spokesman said. It was their first face-to-face meeting since March 6, 2017, in Antalya, Turkey. They also met on Feb. 16, 2017, in Baku, Azerbaijan.

General Dunford has spoken with General Gerasimov more than a dozen times by phone in the past year or so.

“Both leaders recognize the importance of maintaining regular communication in order to avoid miscalculation and to promote transparency in areas where our militaries are operating in close proximity,” Lt. Cmdr. Hayley Sims, a Dunford spokeswoman, said in an email.

Hotlines and boundaries breached

Nearly three years ago, the Russian and American militaries established a special hotline to help prevent disasters in the air. A United States Air Force officer at Al Udeid Air Base in Qatar calls a Russian officer at an air base in Latakia, Syria, every day to head off — or “deconflict” — potential problems over Syria.

The daily phone calls between the air officers have remained professional. But the dialogue does not always translate into cooperation in the skies.

Last December, Russian fighter jets flew dangerously…