Sven Jaschan, 19, was found guilty of computer sabotage and illegally altering data, said Katharina Kruetzfeld, a spokeswoman for the court in the northwestern town of Verden. He was given a suspended sentence of one year and nine months.
Jaschan also must perform 30 hours of community service at a hospital or home for the elderly, but will not have to pay court costs.
Jaschan admitted to creating the worm at the beginning of his trial Tuesday — reiterating a confession to authorities at the time of his arrest in May 2004.
The proceedings were held behind closed doors because he was a minor at the time.
Jaschan was arrested at his family's home after Microsoft Corp. received a tip from an informant seeking a reward. The worm had raced around the world, exploiting a flaw in the company's Windows 2000 and Windows XP operating systems.
Sasser caused infected computers to crash and reboot, making it impossible to work on them. The worm snarled tens of thousands of computers and caused Internet traffic to slow.
Authorities who questioned Jaschan said they got the impression his motive was to gain fame as a programmer. He was arrested sitting at his computer at the house of his mother, who runs a computer store in the small northern town of Waffensen.
The teenager has told officials his original intention was to create a virus, "Netsky A," that would combat the "Mydoom" and "Bagle" viruses, removing them from infected computers. That led him to develop the Netsky virus further — and to modify it to create Sasser.
Prosecutors had sought a two-year suspended sentence and 200 hours of community work, while the defense sought a one-year sentence. Both sides accepted Friday's verdict.