PARIS — It was shortly before 11 a.m. Wednesday when a small enclave off one of Paris’ large boulevards close to the Place de la Bastilles was shaken with bursts of gunfire and cries of “Allah is the greatest” and “The Prophet is avenged.”

Within minutes, people who rushed to their windows and balconies to see what was going on realized that the long-threatened jihadi operation against Paris was under way.

The target this time was the weekly Charlie Hebdo, one of the liveliest and, perhaps necessarily, most irreverent satirical journals still attracting a major audience in a Western democracy.

By the end of the operation, carried out by a three-man commando group armed with assault rifles, at least 12 people were dead and six others injured.

Among those killed — it’s better to say executed — were 10 members of the weekly’s editorial staff, including the flower of French political cartoonists: Stephane Charbonnier, alias “Charb,” Jean Cabut, alias “Cabu,” Bernard Tignou and the magazine’s top star, Georges Wolinski.

All had been threatened with death on numerous occasions, especially for drawing and publishing cartoons of the Prophet Muhammad (including one with a bomb hidden in his turban) and for a special issue, renamed “Sharia Hebdo” for the occasion, with “Muhammad” as guest editor.

In 2011, Charlie Hebdo was also the only major publication in the West to republish the Danish cartoons of Muhammad that provoked violence in numerous countries.

In 2013, Foreign Minister Laurent Fabius distanced the French government from the weekly’s in-your-face criticism of Islamism and Islam and warned Charlie Hebdo not to push provocation too far.

Wednesday’s attack must have been carefully planned and based on some inside information. For it came precisely as Charlie’s weekly editorial meeting was under way with a maximum turnout of writers, cartoonists and editors.

The attack also came only hours after the weekly’s new issue went on sale with a cover inspired by a new novel by Michel Houelbeque, which envisions the election of a Muslim as France’s president in 2022.

The government had provided police protection for four of the weekly’s key editors. The assassination of three of them on Wednesday suggests the protection may have been more formal than real.

The style of the attack and the getaway, the weapons employed and the safe haven — probably set up in Seine-Saint Denis, a suburb of Paris with a large Muslim population — indicate some input from professional armed bandits who appear to have reached a coordination agreement with jihadists.

Two hours after the attack, President Francois Hollande, accompanied by a raft of high officials, visited the scene of the carnage to recite a cliché-ridden statement about resisting terror and defending freedom of speech.

The problem, however, is that successive French administrations on both left and right have failed to develop a coherent position on terrorism, especially the Islamist variety, let alone forge policies to effectively deal with it.

Since the 1960s, France has been a target for terror attacks by various Palestinian, Algerian and Lebanese groups, as well as others sponsored by the Islamic Republic in Iran or backed by Marxist organizations linked to Cuba and the now-defunct Soviet Union.

All along, French policymakers have been divided between a desire to make a deal with terror groups in the hope of securing immunity and the necessity of fighting them with all it takes.

In the 1970s, France purchased immunity for its civilian aircraft by providing regular unofficial “financial contributions” to Palestinian groups involved in the business of hijacking.

In the 1980s, Paris bought an end to Tehran-sponsored terror attacks, which had claimed dozens of lives in Paris and other cities, by releasing over a million dollars in frozen Iranian assets.

In the 1990s, Algerian terror groups were bribed into offering immunity to France by a decision to ignore their fundraising and recruiting activities on French territory.

Over the years, successive French governments have also arranged for the payment of ransoms in exchange for the liberation of over 100 French hostages in the Middle East and Africa.

In the context of a so-called “Arab Policy,” successive administrations have also banked on the illusion that, by casting France as the sole Western friend of “the Arab and Muslim masses,” they would buy security while also benefiting from business opportunities.

Thus, France was the first Western power to impose a ban on arms exports to Israel, and the first to allow Yasser Arafat’s Palestine Liberation Organization to open an “embassy” in its capital.

In 1996, a French refusal to put several organizations including Hezbollah and Hamas on a terrorist list prevented the adoption of a G-7 agreement on 45 measures to combat global terrorism.

In 2003, France did all it could to prevent joint UN action against Iraqi tyrant Saddam Hussein.

Last month, France also stood apart by voting in the UN Security Council for an Arab resolution to recognize the Palestinian Authority as a nation-state without a peace agreement with Israel.

Wednesday’s horror is a bitter lesson on the limits of this strategy of appeasement.