ANKARA, Turkey — Vice President Mike Pence on Thursday agreed to a deal with President Recep Tayyip Erdogan that accepted a Turkish military presence in a broad part of northern Syria in exchange for the promise of a five-day cease-fire, completing an abrupt reversal of American policy in the Syrian conflict.

Emerging from close to five hours of talks after a hastily arranged trip to Ankara, the Turkish capital, Mr. Pence hailed the agreement as a diplomatic victory for President Trump, calling it a “solution we believe will save lives.”

The agreement “ends the violence — which is what President Trump sent us here to do,” Mr. Pence said at a news conference at the ambassador’s residence.

Turkey’s foreign minister, Mevlut Cavusoglu, immediately contradicted the description of the agreement, saying it was not a cease-fire at all, but merely a “pause for our operation.” He added that “as a result of our president’s skillful leadership, we got what we wanted.”