"The man had gathered information on bomb-building from the Internet and downloaded propaganda from IS," the Attunda District Court said. "He is now sentenced to five years in prison for preparing to commit a terrorist crime."
The man, named as Aydin Sevigin, was found guilty of buying materials such as a pressure cooker and ball bearings to make a bomb, intending to blow himself up in a suicide attack.
The Prosecution Authority believe the man had earlier tried to join the jihadist group Islamic State in Syria, but was twice stopped in Turkey and sent back to Sweden.
Sweden has not been hit by a large-scale militant attack, but local media reported in April that authorities received intelligence about a possible attack on the capital by Islamic State militants. In 2010 a suicide bomber died when his bomb belt went off prematurely in central Stockholm.