Salman Rushdie has jumped to the defence of the 12 murdered cartoonists from French satirical magazine Charlie Hebdo.

He spoke of his anger that the artists had been "vilified and called racists" following the attack on their offices by two brothers directed by al-Qaeda in the Arabian Peninsula (Aqap).

Rushdie was himself threatened with death after his book, The Satanic Verses, was published in 1988. He made the defence after a speech at the University of Vermont in the United States, when asked about the attacks.

"The French satirical tradition has always been very pointed and very harsh, and still is, you know," he told the audience.

"The thing that I really resent is the way in which these, our dead comrades... who died using the same implement that I use, which is a pen or pencil, have been almost immediately vilified and called racists and I don't know what else."

The author, born in India but educated in Britain, was once the subject of a fatwa issued by Iran's Ayatollah Khomeini and was forced into hiding until it was lifted in 1998. He expressed his staunch support for freedom of speech and said this freedom should be upheld, even if it caused offence to Muslims.

"Both John F Kennedy and Nelson Mandela used the same three-word phrase which in my mind says it all, which is, 'Freedom is indivisible.'" Rushdie said.

"You can't slice it up, otherwise it ceases to be freedom. You can dislike Charlie Hedbo. But the fact that you dislike them has nothing to do with their right to speak."