Secretary of State Mike Pompeo reassured Afghans on Tuesday that the United States will not negotiate behind their backs even as it seeks to foster a peace deal with the Taliban leading to the withdrawal of 14,000 U.S. troops.

After meeting with President Ashraf Ghani during an unannounced visit to Kabul, the capital, Pompeo declared that after 18 years of war, “the hour has come for peace.”

Pompeo’s stop in Afghanistan while en route to India comes as U.S. officials and Taliban leaders plan to sit down together in Qatar for a seventh round of talks aimed at ending the war. Pompeo said he hopes for a peace deal before Sept. 1, ahead of the presidential election in Afghanistan. The talks are expected to focus on Taliban demands for the withdrawal of foreign troops, most of them American, and a U.S. demand for an end to militant attacks plotted from Afghan soil.

“While we’ve made clear to the Taliban that we’re prepared to remove our forces, I want to be clear, we’ve not yet agreed on a timeline to do so,” Pompeo told reporters in a news conference after spending about seven hours in Kabul.

Pompeo said participants in the Qatar talks, led by U.S. envoy Zalmay Khalilzad, are nearly ready to finish a draft text outlining the Taliban’s commitment to ensuring that the country is never again used as a safe haven for terrorists. Khalilzad accompanied the secretary to his meetings with Afghan leaders.

But Pompeo also said the United States will insist that the Taliban have dialogue and eventually negotiations with representatives of the Afghan government. So far, the Taliban has refused to talk to Afghan government representatives, calling them “puppets.”

Pompeo sought to address Afghan fears of abandonment, assuring them that even as the United States draws down its troop presence, it will continue to support gains made by Afghan women and other groups.

“We’re working to bring Afghans together to negotiate at the table to decide the future of their own country,” he said. “When that table is put together, it will be a large table. It is crucial to include not just the Taliban and the government, but also representatives of opposition parties, civil society, including women and youth.”

During his visit, Pompeo spoke briefly about Iran, saying he couldn’t share much more information about Iran’s involvement in the country.

But he added, “It is not in Iran’s best interest to undermine this peace process. I would hope that they could see that it is in every regional player’s best interest that this peace process move forward.”

At a news conference earlier this month, Pompeo cited several incidents that he said were “instigated by the Islamic Republic of Iran and its surrogates against American and allied interests,” including a bombing in Kabul that killed several Afghans and wounded four U.S. service members.

Pompeo began his trip to the Middle East and Asia with meetings with leaders in Saudi Arabia and the United Arab Emirates on Monday, as he recruits support for a new program to monitor threats from Iran in the Persian Gulf region.

Iran has denied being involved in recent attacks on tankers in the region but acknowledged shooting down a U.S. surveillance drone, which it said was in Iranian airspace. The United States maintains that the aircraft was flying over international waters.