On Friday, over lunch, I heard the news that Salman Rushdie would not be attending the Jaipur Literature Festival. His visit had been in doubt for some time. Initially we had been scheduled to have a conversation on stage that afternoon, but since Maulana Abul Qasim Nomani, the head of the Darul Uloom seminary in Deoband, had called for him to be prevented from entering India, the festival organisers had been fighting a storm of manufactured controversy, not unconnected with the upcoming Uttar Pradesh state elections.

Salman has been visiting India without incident for many years, and spoke at the JLF in 2007. Clearly, the sudden eruption of righteous indignation at his presence was not spontaneous. The manipulation of religious sentiment for political ends has a long history in India, and this was merely a particularly cynical example of a traditional election-time activity.

Initially, the directors of the JLF asked Salman to delay his arrival while they worked with the authorities to provide security, and attempted to defuse a planned protest. Our Friday event was moved to Tuesday morning, and his name was removed from the festival programme. Then came the news, apparently originating in police intelligence reports seen by the festival team, that three assassins had been dispatched from Bombay with orders to murder him. Now there appears to be doubt about the veracity of these reports – Mumbai police deny that they communicated any such intelligence, and the Hindu newspaper has reported that the story of the assassins was concocted by the Rajasthani police. Whatever the truth of this, it was enough to prevent Salman from travelling to India.

Amitava Kumar and I were extremely angry. We felt that it was important to show support for Salman, who is often misrepresented and caricatured as a sort of folk-devil by people who know little or nothing about his work. This situation has arisen in India at a time when free speech is under attack. Recent moves to institute "pre-screening" of internet content, and kneejerk bans of books such as Joseph Lelyveld's masterly biography of Gandhi, show that these are not good times for those who wish to say unpopular things in the world's largest democracy.

We decided that we would use our afternoon session, in which Amitava was due to interview me about my novel Gods Without Men to highlight the situation. We decided (without consulting the festival organisers, or anyone else) that I would make a statement, and then we would quote from The Satanic Verses. We knew this little-read and much-burned book was banned in India, but it was our understanding that this meant it was a crime to publish, sell or possess a copy. We knew it would be considered provocative to quote from it, but did not believe it was illegal. A pirated text exists on the internet, and we downloaded two passages, 179 and 208 words in length respectively.

Our intention was not to offend anyone's religious sensibilities, but to give a voice to a writer who had been silenced by a death threat. Reading from another one of his books would have been meaningless. The Satanic Verses was the cause of the trouble, so The Satanic Verses it would have to be. We did not choose passages that have been construed as blasphemous by Muslim opponents of the book – this would have been pointless, as these passages have overshadowed the rest of the content of the novel, which concerns the relationship between faith and doubt, and contains much that has nothing to do with religion whatsoever. We wanted to demystify the book. It is, after all, just a book. Not a bomb. Not a knife or a gun. Just a book.

To the audience in the Durbar Hall, I read the following statement. It is a little rough, as it was written in haste:

Today, I am sad to say, is a bleak day for Indian literature. We heard earlier from Gurcharan Das, Alex Watson and Oscar Pujol about the place that doubt, dissent and argumentation held in the very origins of Indian thought [this is a reference to an earlier session, which dealt with scepticism in Vedic philosophy]. Today, one of India's greatest novelists, Salman Rushdie – a writer whose work enshrines doubt as a necessary and valuable ethical position – has been prevented from addressing this festival by those whose certainty leads them to believe that they have the right to kill anyone who opposes them. This kind of blind, violent certainty is in opposition to everything the festival stands for – openness, intellectual growth and the free exchange of ideas. There are many rights for which we should fight, but the right to protection from offence is not one of them. Freedom of speech is a foundational freedom, on which all others depend. Freedom of speech means the freedom to say unpopular, even shocking things. Without it, writers can have little impact on the culture. Unless we come out strongly in support of Rushdie's right to be here, and to speak to us, we might as well shut the doors of this hall and go home.

Then I read from the novel. I had already finished when Sanjoy Roy came to the side of the stage and told us that we shouldn't continue. Amitava and I spoke for some time about the influence of Rushdie on my work, and of the themes of doubt and certainty in Gods Without Men. He then quoted the second excerpt, a description of what London might be like if it was "tropicalised", one of many comic passages in The Satanic Verses which have no religious content. I would link here to the passages we read, which I maintain are absolutely inoffensive to even the most delicate religious sensibility, but given my current legal circumstances, this does not seem wise.

At the end of the session, I signed books. Quickly a mob scene developed as I was surrounded by journalists who wanted to know why Amitava and I had made our protest. Backstage, the festival organisers were upset. This was something about which they had no foreknowledge, and over which they had no control. The bad atmosphere was compounded by the news that, completely independently, two other writers – Jeet Thayil and Ruchir Joshi – had also read from The Satanic Verses. I was not present at that reading, and I'll leave it to them to give an account of their actions and intentions.

News of the readings travelled fast. Sanjoy Roy was soon taking calls from clerics and politicians, including one from the chief minister of Rajasthan. The Jaipur police commissioner arrived, interviewed us briefly, and went away, apparently reassured that no law had in fact been broken.

A lawyer appeared who closeted himself with the festival organisers. He drafted a statement, which we were asked to sign, making clear that the festival was not responsible for our actions. It was left to my friend Sara Chamberlain to find someone to provide legal advice to me. This advice was blunt: I should leave India immediately, as otherwise I risked arrest and might well find myself unable to return home to New York until any resulting cases had been resolved.

The festival organisers later informed me that they had been advised that it was unsafe for me to stay in Jaipur, and my continued presence at the festival would only inflame an already volatile situation. I left early on Saturday morning, and left India the same day.

I would like to reiterate that in taking this action I believed (and continue to believe) that I was not breaking the law, and had no interest in causing gratuitous offense. I apologise unreservedly to anyone who feels I have disrespected his or her faith.

I refute absolutely the accusation of Asaduddin Owaisi, the Hyderabad MP who has accused me of "Islam-bashing under the guise of liberalism". I stand on my public record as a defender of the human rights of Muslims, notably my work for Moazzam Begg and other British Muslims detained without trial in Guantánamo Bay.

To Mr Owaisi, and others who feel that the notion of "freedom of speech" is just a tool of secular western interests, a license to insult them, I say that the contrary is true. Freedom of speech is the sole guarantee of their right to be heard in our complex and plural global culture. It is the only way of asserting our common life across borders of race, class and religion. Just as I reach out my hand to Salman Rushdie, I do so to Mr Owaisi, and to Maulana Abul Qasim Nomani, whose seminary is, after all, called the "House of Knowledge", in the hope that, as fellow believers in the vital importance of words, we can resolve our differences – or at least come to understand them correctly – through speech and writing, instead of violence and intimidation.

• Comments on this article will be switched off overnight and turned on again at 9am Monday (23 January, UK time)