Virus writer Sven Jaschan has been found guilty of computer sabotage and illegally altering data after releasing the Sasser worm in May 2004.
The court in Verden, in the north west of Germany, gave the teenager a suspended sentence of one year and nine months.
Jaschan was caught following a tip-off to police after Microsoft offered a $250,000 reward for information leading to the conviction of the worm's creator.
"Sven Jaschan avoided a jail sentence by the skin of his teeth because he was arrested within days of his 18th birthday. He was lucky that the police caught him when they did," said Graham Cluley, senior technology consultant at Sophos.
"Nevertheless, his name will always be associated with some of the biggest viruses in the history of the internet."
Cluley added that a Sophos survey of almost 1,000 people last month found that 66 per cent believed that a jail sentence is the most appropriate punishment for writing a virus.
Jaschan has told officials that his original intention was to create a virus that would combat the Mydoom and Bagle viruses and remove them from infected computers. This led him to develop the Netsky virus further, and to modify it to create Sasser.
The worm was released in May 2004 and spread round the world with unprecedented speed, accounting for 70 per cent of all infections during the first half of 2004.
Cotton seedling freezes to death as Chang'e-4 shuts down for the Moon's 14-day lunar night
Fortnite easily out-earns PUBG, Assassin's Creed Odyssey and Red Dead Redemption 2 in 2018
Meteor showers as a service will be visible for about 100 kilometres in all directions
Saturn's rings only formed in the past 100 million years, suggests analysis of Cassini space probe data
New findings contradict conventional belief that Saturn's rings were formed along with the planet about 4.5 billion years ago