Johnny Bergenholz Jensen received a one year and six month prison term for attempting to set the Lyngbygård asylum centre on fire and torching a minivan on the property. No person was injured in the attack.
Bergenholz Jensen also drew swastikas, writing "first warning" and "DNSB", an acronym that refers to the National Socialist Movement of Denmark, on the building.
The asylum centre, run by the Red Cross, mainly houses families who have applied for asylum in Denmark. It was the third time the asylum centre was attacked last year.
Bergenholz Jensen said in his defence that be believed that non-Europeans should not live in Denmark and that he had carried out the attacks in protest at government policy, Danish broadcaster DR reported.
In court, Bergenholz Jensen said he did had not intended to harm the residents of the centre.
"I did not want to go after the residents of the refugee centre personally . If I had done so, I could have chosen to burn the centre down," he said.
The court took Bergenholz Jensen's racist motives into account when the verdict was announced, a decision the man's lawyer Lars Henriksen may use to mount an appeal, as he claims the racist motive is not clear.
"I find it a bit odd," Henriksen told Denmark's BT newspaper. "The Attorney-General has decided that there will be a prosecution for racism in this case. Yet we spent most of the day talking about possible racist motives. It is also part of the verdict and sentencing. I am puzzled."
Bergenholz Jensen has admitted to the crimes he was charged with.
"I regret what has happened. It's not a good way of doing politics," he said before the verdict according to Danish newspaper Ekstrabladet.