Afghan police officers keep watch at the site of a suicide bomb attack in Kabul on Friday. (Omar Sobhani/Reuters)

Just a few weeks ago, after a string of bloody insurgent attacks left 150 people dead in Kabul, Afghan President Ashraf Ghani lashed out in frustration, vowing to take revenge on the battlefield of a war that Afghan and NATO forces are still struggling to dominate after 16 years of fighting. 

But Wednesday, in a striking turnaround that implicitly acknowledged the folly of that threat, Ghani took the opposite tack, inviting Taliban insurgents to “unconditional” peace talks, offering them dramatic concessions and recognizing the extremist militant group as a legitimate political force in Afghanistan’s future.

The violence continued Friday, when a car bomb detonated beside a highway leading into Kabul, killing two civilians and injuring 14. No group asserted responsibility, and there has been no immediate formal response from Taliban leaders to the president’s unprecedented proposal at the opening of an international conference in the Afghan capital.

But Ghani’s offer — which included a cease-fire and prisoner swap, passports for Taliban representatives and their families, Taliban participation in elections and a review of the constitution as the group has demanded — was cheered by delegates from 25 countries who gathered to brainstorm how to create conditions for peace.

For months, hopes of reviving long-stalled peace talks with the Taliban have seemed virtually dead. The insurgents have continued waging an aggressive military campaign in the countryside, where they now control or influence nearly half of Afghan territory, while staging repeated attacks in the capital despite intensified security.

Civilian casualties remain at near-peak levels, with about 10,000 reported for 2017. Since 2001, when the Taliban regime fell, the war has cost nearly 200,000 lives, and since 2014 additional violent attacks by regional affiliates of the Islamic State have heightened the sense of mayhem. 

Until now, the Taliban has refused to negotiate with Kabul and said it will not join talks until all foreign forces have left the country. The Trump administration is expanding the size and role of the U.S. troop presence in an effort to strengthen the Afghan defense forces and bring the insurgents to a settlement. 

There were conflicting versions of Friday’s car bombing in Kabul. Afghan police officials said it was aimed at a NATO military convoy but missed its target. A NATO military spokesman in Kabul said that no military convoy was threatened but that the intended target may have been a foreign diplomatic vehicle. The blast followed a suicide bombing Feb. 24 that killed three civilians and wounded a dozen when a man detonated a backpack filled with explosives in Kabul’s fortified diplomatic zone.  

The Islamic State said it was behind the first attack. But on the same day, Taliban forces claimed two suicide bombings in Helmand province that left three Afghan soldiers dead, while 18 Afghan soldiers died in fighting with Taliban insurgents in western Farah province.

The Afghan president’s expansive offer came in sharp contrast to angry comments he made in late January after the spate of insurgent violence in Kabul, which also left more than 400 people injured. The attacks included the storming of a luxury hotel, a raid on an army training academy and a suicide bombing in which an ambulance was used. 

At the time, Ghani’s visceral response echoed comments by President Trump, who abruptly rejected peace talks with the Taliban — even as his aides continued to affirm that the war must be settled through peaceful dialogue. 

“Innocent people are being killed left and right,” Trump said Jan. 29. “We don’t want to talk to the Taliban. We’re going to finish what we have to finish.”

Since then, however, Ghani has made comments welcoming talks with insurgents under certain conditions. On Wednesday, he went even further and used more respectful language, treating the Taliban as a recognized political group.

“We are making this offer without preconditions, in order to lead to a peace agreement,” Ghani said. He described his action as an effort to “save the country” and said that he would not “prejudge” any group interested in peace. 

Although the Taliban has not publicly responded to Ghani’s offer, it has put out several feelers recently. Two weeks ago, the group issued an unusual written appeal to the “American people,” asking them to pressure U.S. officials to end the conflict. The letter, emailed to the news media, cited statistics on the human and economic costs of the war, while calling U.S. officials “warmongers” and usurpers.

In the past week, Taliban officials have contacted various interlocutors, including news outlets and academics. On Thursday, the group posted a letter to Barnett R. Rubin, an Afghanistan expert at New York University, who wrote an open letter in the New Yorker this week encouraging the Taliban to join the peace talks. The Taliban response, shared through Twitter on Wednesday, was polite but dismissed this week’s conference in Kabul as a vehicle for seeking the insurgents’ surrender.

“Such efforts seek surrender from the Islamic Emirate at a time when the Islamic Emirate . . . has defeated an international arrogant power like America,” the letter said, using the formal name of the Taliban movement. 

The letter said the group does not “seek conflict with anyone, including the United States.” But it claimed that Afghanistan is “occupied” and that its government is being “imposed on us.” To recognize and talk with Kabul officials, the letter said, would be to accept “the same formula adopted by America to win the war.”

In next-door Pakistan, which Afghan and U.S. officials accuse of harboring Taliban militants, officials endorsed Ghani’s overture. The Pakistani national security adviser, retired army Lt. Gen. Nasser Khan Janjua, said the government would do its best to support “this noble initiative.”

Some Afghan critics, though, saw Ghani’s outreach as capitulation. Amrullah Saleh, a former national intelligence chief, called the president’s speech “a total appeasement to the enemy.” He noted that after the January attacks in Kabul, Ghani called the nation to arms in defense of peace. “Now he offered the terrorists a super olive branch,” Saleh said.

On Wednesday, Al Jazeera quoted an unnamed Taliban official as saying the group was ready to hold direct talks with American officials at its office in Doha, the capital of Qatar. The official warned, however, that if the Afghan government shuts down or moves that office, it could sabotage any negotiations. He also reiterated that the departure of U.S. troops is a precondition for any talks.

The Qatar office was opened about five years ago as a diplomatic site for Taliban representatives to meet with others. But little came of that effort, and Ghani recently has been reported as planning to move the site to Saudi Arabia. 

On Tuesday, Afghan officials insisted that the Taliban must negotiate with them but said they are ready to meet insurgent officials anywhere. “If you are Afghans, come and talk with Afghanistan,” Haroon Chakhansuri, a spokesman for Ghani, told Tolo News TV in Kabul. “The Afghan government is ready to talk.”

Sayed Salahuddin in Kabul contributed to this report.