Centuries ago, in the pagan times, Scandinavian people believed that elves are house gnomes who guarded their homes against evil. If you were good, the elves were good to you, but if you were bad, the mischievous elves would play tricks on you. Although these gnomes mostly were benevolent, they could quickly turn nasty when not properly treated, so it is told. Some of the tricks they enjoyed playing were giving you nightmares by sitting on your head while you were dreaming, tangling your hair as you slept, making your milk turn sour, and stealing your sausages. Folks believed that if they left a bowl of porridge on the doorstep at night, the elves would be happy and not subject them to their ornery antics. Throughout the centuries, they were either loved or loathed. Some people even believed them to be trolls and cannibals. The perception of gnomes largely depended on whether a person was naughty, or nice.
Read more at http://www.theholidayspot.com/christmas/history/elves.htm#I3K8Gb6SlrSP7r27.99