KABUL (Reuters) - Afghan President Ashraf Ghani left open on Saturday the possibility for talks with militants who accept peace but said the door was closed to those who cause tragedies like recent attacks in the capital, Kabul.

FILE PHOTO: Afghan President Ashraf Ghani speaks during a meeting with US Vice President Mike Pence (not pictured) at the Presidential Palace in Kabul, Afghanistan on December 21, 2017. REUTERS/Mandel Ngan/Pool

An attack on the Intercontinental Hotel in Kabul on Jan. 20 and a suicide bombing on a crowded city street a week later have stoked public anger and stepped up pressure on Ghani’s Western-backed government to improve security.

The attacks, which killed more than 130 people and were claimed by the Taliban, have also raised fresh doubt about long-running efforts to initiate talks with the insurgents.

The president’s office said on Tuesday the militants had crossed a “red line” and peace would have to be won on the battle field.

But Ghani raised the possibility of reconciliation with some militants in a speech to Islamic clerics in Kabul.

“Those who are responsible for this tragedy and do not want peace, the door of peace is closed to them,” Ghani said.

“Those who accept peace, they will witness that the nation will embrace them. But there is a clear difference, our commitment to bringing peace does not mean we will sit quietly and won’t retaliate.”

“We will dig them out from any hiding holes.”

Afghanistan’s government has made such vows for years but the insurgency appears ever more resilient. Peace efforts have been made in fits and starts but without progress.

U.S. President Donald Trump appeared to dash any hope for peace efforts on Monday when he condemned the Taliban for the Kabul violence and rejected the idea of talks.

Trump last year ordered an increase in U.S. troops, air strikes and other assistance to Afghan forces, to force the Taliban to negotiate.

But his comments on Monday suggested he saw a military victory over the Taliban, an outcome that U.S. military and diplomatic officials said could not be achieved with the resources and manpower he had authorized.

U.S. Deputy Secretary of State John Sullivan said in Kabul on Tuesday the U.S. strategy had not changed and the aim was still to press the Taliban militarily to convince them that they had to negotiate.

The Taliban are fighting to drive out foreign troops and re-establish their form of strict Islamic law.

Afghanistan has long accused neighboring Pakistan of failing to act against Taliban plotting violence from safe havens on the Pakistani side of the border.

On Friday, Ghani accused Pakistan of being the “Taliban center” and said he was waiting for Pakistani action.

Pakistan denies helping the Taliban and a Pakistani delegation led by Foreign Secretary Tehmina Janjua visited Kabul on Saturday with the aim of fostering cooperation. Janjua called for both sides to stop the “blame game”, Pakistani media reported.

The United States said last month it would cut security aid to Pakistan, complaining it was not doing enough to fight militants sheltering there.