If you are a European citizen, then you are allowed to purchase property in Denmark without prior permission. Non-EU citizens must gain a paper from the Ministry of Justice before they can purchase any property in Denmark and must also confirm that the property will be their residence throughout the year.
If you have lived in Denmark for a minimum of five years, you do not need a residence permit in order to purchase property. EU nationals who are working in Denmark do not need a residence permit to buy property in Denmark either. Non-EU citizens must have a valid residence or business permit in order to purchase property in Denmark.
In all cases, the Civil Law Division of the Danish Ministry of Justice should be contacted in advance (Justitsministeriet).