One of the men was captured on video outside the building waving his arms and shouting "Allah!". After dozens of shots rang out, two assailants were seen calmly leaving the scene. One police officer was seen being shot as he lay wounded. (Paris Attackers Shouted 'We Have Avenged the Prophet': Police)
A police union official said the assailants - Interior Minister Bernard Cazeneuve said there were three - remained at liberty and there were fears of further attacks. The government declared the highest state of alert, increasing security at transport hubs, religious sites, media offices and department stores as the search for the assailants got under way.
Charlie Hebdo (Charlie Weekly) is well known for courting controversy with satirical attacks on political and religious leaders and has published numerous cartoons ridiculing the Prophet Mohammad. Jihadists online have repeatedly warned that the magazine would pay for its ridicule.
The last tweet on its account mocked Abu Bakr al-Baghdadi, the leader of the militant Islamic State, which has taken control of large swathes of Iraq and Syria and called for "lone wolf" attacks on French soil.
President Francois Hollande, who will address the nation on television at 8:00 pm (1900 GMT), rushed to the scene of what appeared to be a carefully-planned attack. Sirens could be heard across the city. (France Puts Paris on Highest Alert Status After Shooting)
"An act of indescribable barbarity has just been committed today in Paris," he said. "Measures have been taken to find those responsible, they will be hunted for as long as it takes to catch them and bring them to justice."
An amateur video broadcast by French television stations shows two hooded men outside the building. One of them sees a wounded policeman lying on the ground, rushes over to him and shoots him dead at point-blank range with a rifle.
The two then walk over to a black saloon car. One casually picks up a shoe left on the ground, and then they drive off.
In another clip on Television station iTELE, the men are heard shouting in French: "We have killed Charlie Hebdo. We have avenged the Prophet Mohammad."
A witness quoted by 20 Minutes daily newspaper said one of the assailants cried out before entering the car: "Tell the media that it is al Qaeda in Yemen!"
The gunmen fled eastwards towards the Paris suburbs, dumping their car in a residential area, police said. They then hijacked another car before running over a pedestrian and disappearing.
"There is a possibility of other attacks and other sites are being secured," police union official Rocco Contento said.
By late afternoon the police presence in central Paris was significantly heavier. A Reuters reporter saw groups of armed policeman patrolling around the Grands Magasins department stores in the shopping district and there was an armed gendarme presence outside the Arc de Triomphe.
Speaking in French, U.S. Secretary of State John Kerry, who has close ties to France, condemned the attack.
The White House said France had been one of the stalwart allies of the United States in the fight against Islamic State, while acknowledging it was not yet clear who was responsible for the attack in Paris.
Another 20 people were injured in the attack, including four or five critically. Police union official Contento described the scene inside the offices as "carnage".
Ten members of Charlie Hebdo staff died in the attack. Sources at the weekly said the dead included co-founder Jean "Cabu" Cabut and editor-in-chief Stephane "Charb" Charbonnier.
"Two black-hooded men entered the building with Kalashnikovs (rifles)," witness Benoit Bringer told TV station iTELE. "A few minutes later we heard lots of shots."
In a video shot by journalist Martin Boudot from a rooftop near the magazine's offices, a man can be heard screaming "Allah"; then followed the sound of three or four shots.
A firebomb attack gutted the headquarters of Charlie Hebdo in November 2011 after it put an image of the Prophet Mohammad on its cover in what it described as a Shariah edition.
France last year reinforced its anti-terrorism laws and was already on alert after calls from Islamist militants to attack its citizens and interests in reprisal for French military strikes on Islamist strongholds in the Middle East and Africa.
"I am extremely angry. These are criminals, barbarians. They have sold their soul to hell. This is not freedom. This is not Islam and I hope the French will come out united at the end of this," said Hassen Chalghoumi, imam of the Drancy mosque in Paris's Seine-Saint-Denis northern suburb.
Dozens of police and emergency services were at the site as police secured a wide perimeter around the shooting site, where a Reuters reporter saw a car riddled with bullet holes.
German Chancellor Angela Merkel was among European leaders condemning the shooting.
"This abominable act is not only an attack on the lives of French citizens and their security. It is also an attack on freedom of speech and the press, core elements of our free democratic culture."
The New York-based Committee to Protect Journalists described the attack as a brazen assault on free expression.
The scale of the violence is appalling," said CPJ Deputy Director Robert Mahoney. "Journalists must now stand together to send the message that such murderous attempts to silence us will not stand."
Late last year, a man shouting "Allahu Akbar" ("God is greatest") injured 13 by ramming a vehicle into a crowd in the eastern city of Dijon. French officials say several attacks were prevented in recent weeks and Valls has said France had "never before faced such a high threat linked to terrorism".
While there was no early claim for the shooting, supporters of Islamic State and other jihadist groups hailed the attack on Internet sites, suggesting the image of Mohammad was the reason for it. (Charlie Hebdo Attacked in Past for Satirizing Prophet Mohammed)
The last major attack in Paris was in the mid-1990s when the Algerian Armed Islamic Group (GIA) carried out a spate of attacks, including the bombing of a commuter train in 1995 which killed eight people and injured 150.