The 63-year-old Pentecostal pastor, Ake Green, gave a sermon on the island of Oland off Sweden's east coast in 2003 blaming homosexuals for the spread of HIV/Aids.
He became the first person convicted of inciting hatred on grounds of sexual orientation under 2002 legislation, provoking debate about freedom of speech and religion in a highly secular and egalitarian country.
The court in Jonkoping, southern Sweden, quashed Mr Green's conviction, finding "nothing indicates the pastor used his position as a cover for attacking homosexuals".
It defended his right to preach what it called "the Bible's categorical condemnation of homosexual relations as a sin", even if such views were "alien to most citizens".
Mr Green called the ruling a relief. "I'll go on preaching but I won't be dedicating so much time to this issue," he said.
The prosecutor had wanted a six-month sentence and was undecided about further appeals.
The Lutheran Swedish Church is progressive, having first allowed women priests in 1958. But it does not permit same-sex marriages. (Reuters)