Secretary of State Mike Pompeo said Monday that President Trump ordered him to reduce the number of U.S. troops in Afghanistan by the 2020 election, in some of the clearest comments to date about Trump’s intentions for winding down the nearly ­18-year conflict.

“That’s my directive from the president of the United States. He’s been unambiguous: End the endless wars. Draw down. Reduce. It won’t just be us,” Pompeo said at the Economic Club of Washington, D.C.

Pompeo suggested that a troop withdrawal is connected to how the president views his job performance, saying a reduction of forces is “not only my expectation, it would be job-enhancing.”

“We hope that overall the need for combat forces in the region is reduced,” Pompeo added.

Trump has expressed frustration with the hundreds of billions of dollars spent in Afghanistan every year and continued violence as the Taliban conducts ­near-daily attacks across the country even as it explores a peace resolution with U.S. diplomats to end America’s longest war.

The latest flare-up occurred Sunday with an assault on the office of the Afghan president’s running mate and former intelligence chief, resulting in the deaths of at least 20 people, according to the Associated Press. No one immediately asserted responsibility for the attack.

Military officials have said that the Pentagon has voiced its concerns about a precipitous withdrawal, but Trump has empowered his special envoy, Zalmay Khalilzad, to reach a deal that allows for a reduction of forces in the country and the ability to continue counterterrorism operations, officials said, speaking on the condition of anonymity to discuss internal deliberations. Military officials have now accepted that Trump, who ran on ending America’s “endless wars,” will demand at least a partial drawdown of troops.

Following Pompeo’s remarks, Trump reaffirmed his desire to get U.S. troops out of Afghanistan but declined to say if they would all be home by election day next year. “Well, I don’t know. We’re moving a lot of them out,” he told reporters. “There is no military solution in Afghanistan. … We hope in the coming days we will be able to urge the Taliban to talk.”

In the first year of his presidency, Trump’s advisers urged him to increase the U.S. troop presence in the country to prevent a total takeover by the Taliban, which controls about half the country. They also reiterated worries that the country could again become a staging ground for terrorist attacks on the United States. In heeding his advisers’ warnings, Trump increased troop levels but noted that it went against his instincts.

“My original instinct was to pull out, and historically, I like following my instincts,” Trump said in an address on Afghanistan in August 2017. “But all my life I’ve heard that decisions are much different when you sit behind the desk in the Oval Office.”

With little progress to show in the country after more than two years in office, Trump has expressed frustration with his advisers. On Monday, Pompeo described a resolution the president was seeking concerning the war.

“We think there’s a path to reduce violence, achieve reconciliation and still make sure that the American counterterrorism effort in Afghanistan has value and the potential to reduce risk in the United States,” Pompeo said.

In the U.S. government, the secretary of defense takes orders from the president on troop presence, but Pompeo has taken an expansive role on Trump’s national security team. In June, Pompeo took the unusual step of holding meetings with military leaders at U.S. Central Command headquarters in Tampa to discuss threats posed by Iran. Last week, a State Department release said that Pompeo “dispatched” the chairman of the joint chiefs to Kabul to discuss peace in Afghanistan, language that some viewed as disrespectful toward Gen. Joseph F. Dunford Jr., who does not take orders from the secretary of state.

Another sign of the Trump administration’s eagerness to withdraw came last week, when the United States and Afghanistan issued a joint statement saying they agreed to “accelerate efforts” to advance the peace process to end the war and reduce the U.S. presence in the country. The statement followed a phone call between Pompeo and Afghan President Ashraf Ghani in which the two men agreed to a conditions-based withdrawal.

That same week, Trump said at the White House, “If I wanted to win that war, Afghanistan would be wiped off the face of the Earth.” He said he didn’t want to wage such a brutal bombing campaign though because it would kill 10 million people.

During his remarks Monday, Pompeo took questions from the president of the Economic Club, David Rubenstein, who asked him about Russia’s crackdown on protesters in Moscow, where more than 1,300 people have been arrested.

“I’ve read the reports, I don’t have anything to add this morning,” he said. “I think everyone understands the U.S. position. . . . We always support freedom of expression.”

Pompeo also ruled out a run for the U.S. Senate in Kansas, saying it’s “off the table.” He did not rule out a run for the presidency at some future date.

“If I thought I could do a good turn, there’s nothing I wouldn’t consider doing for America,” he said.

When asked to describe North Korean leader Kim Jong Un, Pompeo said he is “bright,” and “managed to rise to the level of leadership in a difficult environment.”

“I’ve spent more time with him than any other American,” he said.

“I passed Dennis Rodman on this last trip” he said, eliciting laughter from the crowd.

Dan Lamothe contributed to this report.