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

After meeting with President Ashraf Ghani on an unannounced visit to Kabul, Pompeo declared to reporters 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 hoping to end 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 17,000 foreign troops, most of them American, and the U.S. demand for an end to militant attacks plotted from foreign soil.

“While we’ve made clear to the Taliban that were 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, the capital.

Pompeo said participants in the Qatar talks led by U.S. envoy Zalmay Khalilzad, who accompanied Pompeo to his meetings with Afghan leaders, have nearly finished a draft text to outline the Taliban’s commitment that the country will not be a safe haven for terrorists. But he 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 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 that nation’s involvement in Afghanistan.

But he said, “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 this month, Pompeo cited several instances 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.