The Social Democrat leader released a statement, saying: "I condemn the horrific attack which took place in Paris today. My thoughts go to the victims and their families."
The Prime Minister added that the shootings at the magazine's office amounted to "a disgusting attack on democratic foundations," adding that it underscored "our responsibility to always stand up for freedom of expression and press freedom".
He said he planned to send a telegram to fellow socialist President François Hollande and promised that Sweden would give its support to France "at this difficult time."
Men armed with automatic weapons opened fire at Charlie Hebdo's headquarters on Wednesday morning, with prosecutors later confirming that a dozen people had been killed including two police officers.
The same offices were firebombed in 2011 after the magazine published cartoon images of the prophet Mohammed.
France raised its terror alert status to highest level after the shootings, with three gunmen reported to be still on the run.
Swedish Foreign Minister Margot Wallström took to Twitter earlier on Wednesday to voice her concerns, describing the attack as "horrendous".
Horrendous terror attack in Paris, leaving many people dead. Those responsible must be pursued. Free speech must be defended.
— Margot Wallström (@margotwallstrom) January 7, 2015
The attack was also criticized by the president of Sweden's journalism organisation SJF – Jonas Nordling – who described it as "a heinous deed."
"Those who silence anyone by resorting to violence, must be condemned in the most serious way," he told Swedish broadcaster SVT.
According to Nordling, Swedish police are not aware of any organized threat against Swedish journalists, but he still worried about future attacks in the country.
"There are at least a few people who believe they have the right to kill people because they do not share their view. This is a threat that exists in Sweden," he said.
But Jonathan Lundqvist from Reporters Without Borders, which campaigns for free speech within journalism, argues that different traditions in public discourse could mean that Sweden is less likely to be attacked than other European countries.
"In France they are less afraid to provoke and have a lively political discussion. They chose for example, to publish the cartoons, while newspapers in Sweden abstained," he told SVT.
Speaking about the potential future consequences of the attack in Paris, he said: "In the short term, editorial offices in France and around Europe need to review their security practices… In the longer term the great danger is that journalists begin to self-censor themselves. That would be devastating."
French President Francois Hollande arrives on the scene of the shooting. Photo: TT