A deadly Taliban attack in Kabul on April 19 killed 64 people and injured 347 others. President Ashraf Ghani said Monday that he is stepping back from attemps at peace with the insurgents. (Rahmat Gul/AP)

Afghan President Ashraf Ghani stepped back Monday from attempts to engage Taliban insurgents in peace talks, vowing that Afghanistan will instead “execute” enemies of the state and undertake preparations for an extended war.

In a speech that signaled a significant shift in policies, Ghani left open the prospect of dialogue with Taliban fighters who put down their weapons. But he labeled the broader Taliban organization and its Pakistan-based offshoot, the Haqqani network, as “terrorists” and promised expanded attacks by the Afghan military.

Ghani’s remarks are a setback for the Obama administration’s hopes that the 14-year Taliban insurgency could be ended through a negotiated settlement. Back-channel discussions have been held for the past three years to try to establish a framework for such talks.

“The enemies of Afghanistan should realize, if they are captured in the battlefield fighting against the people of Afghanistan, or in terrorist activities, they will definitely be handed over to the law and will be dealt with on the basis of the law,” Ghani said. He added that his government will resume capital punishment for convicted terrorists.

He spoke before a joint meeting of parliament nearly a week after Taliban assailants killed 64 people and injured 347 others in Kabul in one of the largest attacks in the capital in years.

In response, Taliban spokesman Zabiullah Mujahid insisted that the militants would not back down. He called the Afghan leaders “mercenaries imposed on the nation” by their U.S. allies.

The linchpin for peace talks has always been Pakistan, which has permitted some of the Taliban leaders to reside there.

Pakistan has been unable — or unwilling — to apply enough pressure on the Taliban to enter negotiations. And U.S. and Afghan military officials now think most Taliban factions have united behind a call by the group’s supreme leader, Akhtar Mohammad Mansour, to fight at least through this year.

In his speech, Ghani demanded that Pakistan arrest and hand over Taliban leaders who find refuge in that country’s eastern region.

If Pakistan fails to act, Ghani said, Afghanistan will push for “responsible international entities” to “act outside of Afghanistan against the criminals whose hands are stained in the blood” of Afghans.

Western diplomats have stressed that Pakistan is probably limited in what it can do without risking a domestic backlash that could destabilize the nuclear-armed country.

Despite his tough talk toward the Taliban and Pakistan, much of Ghani’s speech appeared to be aimed at shoring up his domestic political support.

In recent months, Ghani and the country’s chief executive, ­Abdullah Abdullah, have struggled to agree on nominees for scores of government positions. Afghans have criticized Ghani for failing to boost the economy or fix soaring unemployment.

Ghani’s leadership will be further tested by two upcoming international conferences that will decide whether foreign donors, including the United States, will continue to spend $7 billion annually to pay for reconstruction and the country’s military.

President Obama also must decide later this year whether to follow through on his plan to reduce U.S. troop levels from the current 9,800 to 5,500 by January.

For months, Afghan critics have accused Ghani — a former World Bank official who spent much of his adulthood in the West — of being too disconnected from everyday hardships.

The speech “was not based on [Ghani’s] depth of strategy and [was] just a reaction of developments, to reduce the level of people’s mistrust,” said Fawzia Koofi, an Afghan parliament member.

But Mohammad Nateqi, a former Afghan diplomat, said Ghani has at least attempted to clarify his objectives.

“This is a turning point and change,” Nateqi said. “His tone was focusing on defensive and war preparations.”