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.”