The man was arrested on Sunday and lives in Uppsala county, just north of Stockholm. The man's lawyer Leif Silbersky told news agency TT that his client denies any wrongdoing and has difficulty understanding what he has supposed to have done.
"He has expressed not nice views on Facebook, critical of immigrants, critical of the Social Democratic Party and the Sweden Democrats. It's the only thing I can think is behind this. That he would prepare an act of terrorism is unthinkable," a source close to the suspect said to news agency TT.
According to the court's ruling, the man will be held for one week as prosecutors gather more evidence.
Prosecutor Ewamari Häggkvist chose not to comment on what the suspect is supposed to have done or had as a motive.