"The three people now charged in Gothenburg district court are suspected of preparing to commit murder in September 2011 in Gothenburg. The planned victim for the attack was the artist Lars Vilks," prosecutor Agnetha Hilding Qvarnström said in a statement.
Vilks has faced numerous death threats and another suspected assassination plot since his cartoon was first published by a Swedish regional newspaper in 2007, illustrating an editorial on the importance of freedom of expression.
The three men planned to stab Vilks to death, Qvarnström told AFP.
"When the three were arrested, they were all carrying knives. One of them had even bought his knife the same day," she said.
The men were identified in documents submitted to the Gothenburg court as Abdi Aziz Mahamud, a 26-year-old Somali citizen living in Sweden, and Swedish citizens Salar Sami Mahamood, 24, and Abdi Weli Mohamud, 26.
The three were arrested, along with a fourth man since released, by an elite counter-terrorism unit in Gothenburg that evacuated hundreds of people from a building hosting an art fair "after concluding that there was a threat that could endanger lives or health or cause serious damage."
Vilks had initially said on his blog that he would attend the art fair although he did not in the end.
Press reports have suggested that the trio had ties to the Somali Islamist movement al-Shabaab, but Qvarnström said she had no information to support such claims.
"We have found al-Shabaab material in a computer (belonging to one of the men) but I can't say that they have any links," she said.
Among the evidence to be submitted in the case is a piece of paper detailing the plans for the murder, the prosecutor said.