THE terrible details of the terrorist attacks in Paris on Friday night are still emerging today, but for many in France and around the world, one word used by President Francoise Hollande seemed to sum up the international reaction to the killings: "war". The attacks in which at least 129 people died were an act of war, said the president, and France would do everything necessary to fight back. "France will be ruthless in its response to Islamic State," he said. "This country needs to make the right decisions to fight this war."

In the aftermath of a profound and shocking attack not only on the French state but on European democracy as a whole, such tough talk from the president is entirely understandable. The attacks on Friday were co-ordinated and highly organised and in claiming responsibility for them, Islamic State said they were a direct response to France's military campaign, which has included bombing operations in Syria and action against Islamic terrorists in Mali.

However, in the coming weeks and months, President Hollande and his allies in the international community need to be cautious about seeing the response to the Paris attacks as any kind of war. The president referred to the attackers as a terrorist army, but it is no army in the traditional sense just as Islamic State is not a country as we understand it. This makes fighting a war against them, using the traditional weapons of war, deeply problematic. The debacles of Iraq and Afghanistan also prove what happens when a "war" is launched hastily against a terrorist target.

Part of the problem with the campaigns in Iraq and Afghanistan, and later our intervention in Libya, was that very little thought was given to what would happen after the fighting. Not only did the presence of western soldiers in the Middle East hand a propaganda coup to IS (one which they were still using on the streets of Paris on Friday), the lack of any kind of coherent plan for rebuilding the states post-war led to the creation of political vacuums in which terrorism and extremism could thrive. No doubt there will be increased pressure in the weeks to come for direct military action in Syria, including ground troops, but, in revenge for Paris, the international community must avoid repeating the mistakes of old.

There are other examples that point to a better way. On 22 July 2011, Anders Breivik killed 77 young people on the island of Utøya in Norway, but in the aftermath of the attacks, Norway reaffirmed its commitment to migration, integration and a liberal democracy. That should be our response to Paris too. There will be angry voices (and they could be heard in the disturbing rise in religiously-motivated attacks reported by Police Scotland over the weekend), but the right response is to say: we carry on. The Prime Minister David Cameron put it this way: we come together and stand united. The First Minister Nicola Sturgeon put it another: diversity is our strength.

There is a second international example that should guide the response to Paris: Northern Ireland. Not only did the citizens of the UK carry on in the face of terrorist attacks, the Troubles proved in the end that hard-core tactics such as imprisonment without trial and soldiers on the ground cannot win the struggle against a small band of terrorists – instead, peace was found through engagement, realpolitik and a proper consideration of where power and influence really lies. The same should apply to the struggle against IS and that means that some recent enmities (towards President Bashar al-Assad of Syria for example) will have to be put aside in the name of the greater goal.

Here in the UK, where the threat of a terrorist attack remains severe, a careful, co-ordinated and firm response is required from the UK and Scottish governments and it needs to happen on two fronts: practical and cultural.

On the practical front, we should be careful not to assume that pulling down the shutters at our borders is the appropriate response to Paris. The Home Secretary Theresa May says more police will be deployed on British streets and more checks and searches will be carried out at our borders, which is appropriate and welcome, but we should be careful not to label all asylum seekers as terrorists. In the next few days, a group of Syrian refugees will arrive at Glasgow Airport in the latest phase of the government's vulnerable person relocation scheme. They will then be housed across the country by the 17 local authorities who have offered to accommodate them.

There will be some Scots who think taking Syrians in at this sensitive time is the wrong decision, but it is a measure of the kind of community that the Paris terrorists wish to destroy that we continue to offer help to those who need it. As the president of the European Commission Jean-Claude Juncker put it, those who organised the Paris attacks are exactly those who the recent refugees have been fleeing.

However, offering the hand of friendship should not preclude a clear head on what is needed to keep us safe and secure. There can never be am absolute guarantee of safety, and to some extent the British security services are caught between two competing pressures. On the one hand, if they seek to increase their powers of surveillance, they are greeted with cries of "police state"; on the other, if an attack does happen in the UK, everyone will be asking: why was more not done to prevent it?

However, the fact that at least one of the dead attackers in Paris had been flagged up as a possible extremist should remind us of the importance of good intelligence and the need to act on it. The need for blanket surveillance of the type proposed by the UK Government in its Communications Data Bill is still unproven, but a targeted strategy against terrorism based on evidence and intelligence can get results.

There is also more work to be done on the cultural front. Many of the perpetrators of recent atrocities have come from within the communities they have attacked and a solution can only be found within those communities. This means governments and community leaders must work with Muslims to promote the principle of multi-culturalism and this requires governments to be careful to control the rhetoric of war, but it also means Muslims, whether they are community leaders or ordinary members of society, demonstrating publicly and passionately that they too wish to see an end to terrorism and that the murderous acts of the Paris attackers are a perversion of Islam. The greatest danger is the aftermath of Paris is that an entire community or religion is blamed for what happened and that polarisation widens. But to be effective, the anti-terror strategy of France, the UK and our allies has to engage the millions of Muslims who live in peace.