WASHINGTON — President Trump spoke on Tuesday with the deputy leader of the Taliban, Mullah Abdul Ghani Baradar, in the latest sign of his determination to see that a peace deal signed Saturday with the Afghan insurgent group holds, allowing him to withdraw thousands of American troops in an election year.

“I spoke to the leader of the Taliban today. We had a good conversation,” Mr. Trump told reporters at the White House, slightly inflating Mr. Baradar’s position.

“They’re looking to get this ended and we’re looking to get this ended,” Mr. Trump said later in the day. “The relationship is very good that I have with the mullah.”

Mr. Baradar was the Taliban official who, along with Mr. Trump’s envoy for Afghanistan, Zalmay Khalilzad, signed the peace agreement in Doha, Qatar, to begin the withdrawal of American forces from Afghanistan and start talks between the Taliban and the Afghan government, which was not a party to the agreement.