Muhammad cartoon sparks attack on French magazine Charlie Hebdo. Source: guardian.co.uk guardian.co.uk

The French government has rushed to the defence of the satirical magazine Charlie Hebdo after an arson attack on its headquarters as it published an edition featuring a cartoon of the prophet Muhammad on the cover as "guest editor".

The Paris offices of the magazine were gutted after a fire broke out at 1am following reports of a petrol bomb being thrown through a window.

The blaze happened just before the special "Sharia Hebdo" edition hit newsstands on Wednesday morning in what the paper mockingly called a "celebration" of the victory of the moderate Islamist party An-Nahda in the Tunisian elections and the Libyan transitional executive's comments on Islamic sharia law as a main source of the country's law. On the front page a cartoon prophet Muhammad said: "100 lashes if you don't die of laughter!"

Charlie Hebdo's website also appeared to have been hacked to show images of Mecca.

However, French politicians defended the magazine. The prime minister, François Fillon, said: "Freedom of expression is an inalienable value of democracy and any incursion against press freedom must be condemned with the utmost force. No cause justified violent action."

The interior minister, Claude Guéant, said: "You like or you don't like Charlie Hebdo, but it's a newspaper. Press freedom is sacrosanct for the French." He added that all French people should feel solidarity towards the magazine.

François Hollande, the Socialist presidential candidate, told Le Monde newspaper the incident demonstrated that the struggle for press freedom and "respect of opinions" was a permanent battle, adding that "fundamentalism must be eradicated in all its forms".

Many Muslims object to representations of Allah or Muhammad and to irreverent treatment of the Qur'an.

The editor of Charlie Hebdo, known as Charb, denied he was trying to provoke, telling journalists the magazine had been "just doing its job as usual". Another contributor, Patrick Pelloux, said the Sharia Hebdo edition was designed to encourage readers to laugh at any topic.

The main representative body of the Muslim faith in France, the French Muslim Council (CFCM), condemned the fire, while its president pointed out that caricaturing the prophet was considered offensive to Muslims. "The CFCM deplores the deeply mocking tone of the newspaper towards Islam and its prophet, but reaffirms with force its total opposition to any act or form of violence," it said.

It is not the first time the weekly has published Muhammad cartoons. In 2007 a Paris court threw out an attempt by two Muslim groups to sue the paper for reprinting the prophet Muhammad cartoons that had been published by a Danish newspaper and triggered protests worldwide.

The former Charlie Hebdo editor, Philippe Val, was pursued in the French courts on charges of racial injury over its publication of three of the Danish cartoons. He was acquitted.

Tareq Oubrou, head of the Association of Imams of France, said the attack was "an inadmissible act". He added: "Freedom is very important. It is nonetheless important to underline the sensitivity of the situation we face today. I call on Muslims to treat this lucidly and not succumb to what they consider provocations regarding their religion … I personally call on Muslims to keep an open mind and not take this too seriously."

In 2006 the Charlie Hebdo issue containing the Muhammad cartoons triggered a surge in sales to 500,000 copies.