In September 1867, a group of Fenians, members of the Irish Republican Brotherhood, blew a hole in the wall of Clerkenwell prison in London in an attempt to free another member of the organisation. The resulting explosion, while failing to free the prisoner, caused the collapse of a row of nearby working class houses, killing 12 and injuring over a hundred residents.
This was a time when Karl Marx and other revolutionaries supported the cause of Irish independence, particularly because they saw it as an essential precondition for breaking the ties between the working class in the mainland and their own ruling class, who used their domination of Ireland to create an illusion of privilege among the English workers and separate them from their Irish class brothers and sisters.
Nevertheless, Marx reacted angrily to the Fenians’ action. In a letter to Engels he wrote
“The last exploit of the Fenians in Clerkenwell was a very stupid thing. The London masses, who have shown great sympathy for Ireland, will be made wild by it and be driven into the arms of the of the government party. One cannot expect the London proletarians to allow themselves to be blown up in honour of the Fenian emissaries. There is always a kind of fatality about such a secret, melodramatic sort of conspiracy” 
Marx’s anger was intensified by the fact that, not long before the Clerkenwell explosion, large numbers of English workers had joined demonstrations in solidarity with five Fenians executed by the British government in Ireland.
In this brief passage from Marx, there is a neat summary of two of the main reasons why communists have always rejected individual terrorism: that it replaces the massive, self-organised action of the working class with conspiracies by small elites; and that, whatever the intentions of those who carry out such acts, their net result is to drive the working class away from an independent stance and into the hands of the government and the ruling class.
Terrorism yesterday and today
A great deal has changed since Marx wrote these words. The call for national independence, which made sense in an epoch when capitalism had not yet exhausted its progressive role, became inextricably linked, from the First World War onwards, with support for one imperialist camp against another. For Marx, terrorism was an erroneous method used by a national movement that deserved support. In our epoch, the epoch in which only proletarian revolution can offer a way forward for humanity, national movements have themselves become reactionary. Bound up with the endless imperialist conflicts that plague humanity, terrorist tactics have increasingly mirrored the brutal degradation which marks warfare in this period. Where once terrorist groups mainly targeted symbols and figureheads of the ruling class (as in the case of the Russian ‘People’s Will’ group who assassinated Tsar Alexander II in 1881), most of today’s terrorists translate the logic of the states who wage imperialist war – such as the indiscriminate aerial bombing of entire populations – into their own indiscriminate bombings and murders, aimed at a population which is blamed for the crimes of the governments which rule them.
According to today’s pseudo-revolutionaries on the left, behind the religious slogans of al-Qaida or Isis terrorists, we are witnessing the same old struggle against national oppression that the Fenians were engaged in, and today’s marxists should therefore offer support for such movements, even if they distance themselves from their religious ideology and from their terrorist methods. But as Lenin said in response to those social democrats who used the writings of Marx to justify participation in the first imperialist world war: “Anyone who today refers to Marx’s attitude towards the wars of the epoch of the progressive bourgeoisie, and forgets Marx’s statement that the ‘workingmen have no country’ – a statement that applies precisely to the period of the reactionary and outmoded bourgeoisie, to the epoch of the socialist revolution, is shamelessly distorting Marx, and is substituting the bourgeois point of view for the socialist.” (Lenin, Socialism and War, 1915). The murderous means used by groups like Isis and their sympathisers are entirely consistent with their aims – which is not to overturn oppression but to substitute one form of oppression for another, and to ‘win’ at any cost in the gruesome battle between the one set of imperialist powers and another set (such as Saudi Arabia or Qatar, for example) which backs them up. And their ‘ultimate’ ideal – the global Caliphate – even if it is as unrealisable as Hitler’s Thousand-Year Reich, is no less an imperialist venture, demanding well-tried imperialist measures of slaughter and conquest.
Real divisions and false unity
Marx pointed out that the Fenians’ action in London would drive a wedge between the working class movement on the mainland and the struggle for Irish independence. It would create divisions between English and Irish workers which could only benefit the ruling class. Today, the Islamist terrorists make no secret of the fact that their aim is precisely to create divisions through the atrocities they carry out: most of the initial actions of Isis in Iraq targeted the Shia Muslim population, which Isis regards as heretics, with the goal of sparking a sectarian civil war. The same logic in the London or Manchester terror attacks: to sharpen the gulf between the Muslims and the non-believers, the kaffirs, and thus hasten the outbreak of full-blown ‘jihad’ in the central countries. This is further testimony that even terrorism can degenerate in a society which itself degenerating.
Apart from the openly racist right wing, who like the jihadis also long for a kind of race war in the streets, the stock response of governments and politicians to the terrorist attacks in Europe is to raise the national flag and proclaim that ‘the terrorists will not divide us ‘. They talk about solidarity and unity against hatred and division. But from a working class point of view, this is a false solidarity – the same kind of solidarity with our own exploiters which ties workers to the patriotic war efforts of the imperialist state. And indeed, such calls for national unity are often a prelude for mobilising for war, as after the destruction of the Twin Towers in 2001, with the US invasion of Afghanistan and Iraq. This is what Marx meant by workers being driven into the arms of the government party. In an atmosphere of mounting fear and insecurity, when you are faced with the prospect of random massacres in the streets, bars or concert halls, an understandable response of those threatened by such attacks is to demand the protection of the state and its police forces. Following the recent atrocities in Manchester and London, the question of ‘security ‘was a major issue in the recent UK election campaign, with the Tories denouncing Corbyn for being soft on terrorism and Corbyn denouncing May for cutting police numbers.
Faced with the terrorists on the one side and the capitalist state on the other, the proletarian position is to reject both, to fight for class interests and class demands. The working class has a deep need to organise itself independently, including the organisation of its defence against state repression and terrorist provocations. But given the weakened condition of the working class today, this need is a long way from being fulfilled. There is a tendency for many workers to see no alternative but to seek the protection of the state, while a small number of disaffected proletarians are drawn towards the putrid ideology of jihadism. And both these tendencies actively undermine the potential for the class to become self-aware and self-organised. Thus, every terrorist outrage, and every state-sponsored ‘solidarity’ campaign in response to it, must be seen as blows against class consciousness – and ultimately, as blows against the promise of a society based on real human solidarity.
 Quoted in K. Marx and F. Engels, Ireland and the Irish Question (Moscow 1971), p 150
 See for example https://www.marxists.org/history/etol/writers/jenkins/2006/xx/terrorism.html#n6, from the SWP’s journal International Socialism, 2: 110, spring 2006