Löfven spoke at the 'Folk och Försvar' ('People and Defence') national conference at Sälen after his government on Sunday identified cyber attacks as one of the eight main threats to security in its new defence strategy.
Following US intelligence reports about organized hacking by Russia to disrupt the US presidential election, which Russia denies, the prime minister expressed concern that similar incidents could take place in Sweden.
“We should not rule it out and be naive and think that it does not happen in Sweden. That's why information and cyber security is part of this strategy,” Löfven told the TT news agency.
Asked if there was a risk that Russia would attempt to influence Swedish elections, he said: “I can at least not rule it out. It's obviously now documented in the US how it happened there.”
“We've got elections in France and in Germany this year and probably in Italy. I think all countries are now thinking about what could happen in our democracies,” Löfven added.
Sweden will next hold a general election in 2018.
Relations between Sweden and Russia have been frosty in recent years, with Swedish security services reporting that Russian spies are operating in the country and Russia in turn accusing Sweden of peddling “James Bond theories” instead of using diplomatic channels to discuss its fears.
Löfven said that he wanted to alleviate tensions between the two countries.
“It's something we must think about all the time. Foreign Minister Margot Wallström would like to see a meeting with Russian foreign minister Lavrov,” he was quoted by Swedish radio as saying.
However, speaking about the Swedish government's criticism of Russia's annexation of Crimea, he said: “We will we principled and persevere but also see how we can create a dialogue.”