The Glostrup court said Wednesday that the man fondled the teenagers while sleeping in his suburban Copenhagen apartment after a party in 2011.
The girls awoke and interrupted the man, and later reported him to police.
But the court cleared the 31-year-old of sex crimes charges, saying medical tests show he suffers from "sexsomnia" in which a person engages in sexual activity while asleep.
Michael Laub, a Danish sleep specialist who wasn't involved in the case, said it's a rare but widely recognized sleep disorder.
The defendant said he had no recollection of what happened.
Prosecutor Martin von Buelow said he wouldn't appeal the ruling.
More Nation & World Headlines
Nuclear smugglers sought terrorist buyers Two win Nobel Prize for missing piece in neutrino mass puzzle U.S. strike on hospital was mistake, top general in Afghanistan says US to release 6,000 prisoners as part of sentencing-reform campaign Ex-UN General Assembly head among 6 held in bribery scheme American heating bills set to be lowest in at least four winters Clinton ad seizes on Rep. McCarthy’s Benghazi comments After weeks of unrest, Palestinian leader appeals for calm
Our new comment system is not supported in IE 7. Please upgrade your browser here.