Sgt. Bowe Bergdahl, right, stands with a Taliban fighter in eastern Afghanistan. (AP)

Michael Semple is a visiting professor at the Institute for the Study of Conflict Transformation and Social Justice, Queen’s University Belfast. He was a member of the United Nations political team that helped implement the 2001 Bonn Accords and served as deputy to the European Union special representative for Afghanistan from 2004 to 2007.

The release of U.S. Army Sgt. Bowe Bergdahl by the Taliban last weekend, in exchange for the freeing of five Taliban figures from Guantanamo, has provoked much agonizing about the rights and wrongs of talking to terrorists. It’s a good moment to consider some of what has been learned from dealing with terrorists — in places from Afghanistan and Pakistan to Northern Ireland — and which lessons have been misunderstood.

1. Freeing Bergdahl involved negotiating with terrorists.

Branding opponents as terrorists may be helpful in legitimizing the fight against them. But the terrorist label is often applied arbitrarily. And it offers a poor guide to whether people are worth talking to.

“What does this tell terrorists, that if you capture a U.S. soldier, you can trade that soldier for five terrorists we’ve gone after?” Sen. Ted Cruz (R-Tex.) asked about the Bergdahl deal. The Afghan Taliban movement, however, is not a classic terrorist organization. Before 9/11, it was the de facto authority in Afghanistan, and talking to its leaders was just something you had to do if you operated there, as did the United Nations and many nongovernmental organizations. Of course, the Taliban leader was foolish enough to give sanctuary to Osama bin Laden, and the movement has spearheaded the post-2001 insurgency in Afghanistan. But unlike al-Qaeda, it has not plotted terrorist attacks on Americans outside Afghanistan.

The Haqqani network, which held Bergdahl for most of his captivity, has rightly been listed by the State Department as a terrorist organization. The choreography of the prisoner exchange was therefore significant. Helped by Qatar, the United States cut the deal with Tayyab Agha, the Taliban’s political representative in Doha — someone who is neither in spirit, nor in law, a terrorist.

2. Civilized governments don’t talk to terrorists.

It’s a familiar refrain. “The United States does not negotiate with terrorists,” State Department spokeswoman Victoria Nuland said in January 2013, when Algerian militants offered to free American hostages in return for the release of Sheik Omar Abdel Rahman , who plotted the 1993 World Trade Center bombing, and Pakistani neuroscientist Aafia Siddiqui. Except that the United States has — during the Iranian hostage crisis and the Iran-contra affair, for example.

The governments of Britain and Ireland have, too. They met with Northern Irish paramilitaries in the run-up to the Irish Republican Army and loyalist cease-fires in 1994, having concluded that the prospect of ending the violence warranted overcoming scruples about engaging with terrorists.

In a Muslim country such as Afghanistan, a government’s willingness to talk to its foes can have even more positive connotations than in the Anglo-Saxon tradition. The government can invoke the Islamic ideal of peace as the essence of civilization and commitment to peacemaking as the hallmark of a just administration.

By contrast, the repressive measures necessitated by counterterrorism campaigns can have a corrupting influence on civilized values.

3. Talking to terrorists encourages more terrorism.

Policymakers sometimes object that bringing terrorist organizations to the table legitimizes and incentivizes violent tactics. And talks may be accompanied by an upsurge in violence rather than a lull — either because terrorist groups think their violent campaign has been effective or because they want to avoid accusations from followers that they have sold out the cause. After the failure of Northern Ireland talks in July 1972, the IRA orchestrated what came to be known as Bloody Friday and set off about two dozen bombs in Belfast.

But a well-constructed talks process will show terrorist organizations that there is a viable alternative to violence and will reward good behavior. Indeed, the history of peacemaking and post-conflict reconstruction is full of people who have transitioned from being labeled terrorists to occupying high public office. Consider former IRA member Martin McGuinness, now deputy first minister of Northern Ireland, and the late Palestinian leader Yasser Arafat.

Of course, context matters. The Afghan Taliban movement has strong command and control and could probably enforce a cease-fire in Afghanistan if it chose to. Next door, the Pakistani Taliban is much more fragmented, and splinter groups have routinely scaled up their attacks whenever talks have gotten underway.

4. We shouldn’t talk to terrorists until they disavow violence.

The best way to sabotage talks is to saddle them with preconditions. In Afghanistan, for years people argued about the need for a Taliban commitment to respect the constitution before it could be admitted to talks. The debate seemed to confuse preconditions with objectives. If the Afghan government were to get into talks with the Taliban, it would want to achieve Taliban acceptance of the constitutional order and an end to violence. But the Taliban would consider these significant concessions, and setting them as preconditions would ensure that talks never took place.

There are models for talks with and without a cease-fire. Northern Ireland experienced both. The Hume-Adams talks and the Irish government’s dealings with loyalist paramilitaries took place against a background of violence but ultimately produced the 1994 cease-fire. Yet parties wanting to take part in the talks leading up to the 1998 peace agreement had to sign on to the Mitchell Principles, which included disavowing political violence.

5. Talking to terrorists is a substitute for using force.

This is the calculation that the Pakistani Taliban made when offering to talk to that country’s government. The group hoped to delay an army operation against it, and to protect its base areas and extortion activities across Pakistan, while offering few concessions or any prospect of a permanent end to violence. Repeated Taliban attacks against the Pakistani army, despite the talks and a cease-fire, dashed Pakistani hopes that talking to the Taliban would remove the need for further army action.

The willingness and ability of a state to implement robust security measures in the face of a terrorist threat both increases the prospects of talks delivering an end to violence and guards against the talks’ potential failure. But a state hoping to talk its way to ending terrorist violence both has to maintain its security stance and address the underlying causes of violence. Talks without security are unlikely to deliver. But security alone is not enough. Talking is far from an easy option.

Read more from Outlook and follow our updates on Facebook and Twitter.