Ahmed Hamed was among a group of migrants who, at the height of Europe's migrant crisis in 2015, pelted police with rocks at the border with Serbia before forcing their way into Hungary. Hamed was sentenced to five years in prison.
In 2017, Prime Minister Viktor Orban's cabinet office sent a migration questionnaire to households in which Hamed's case was mentioned and he was described as a convict.
Hamed argued that this was defamatory since his conviction had not become final until 2018.
Budapest judge Lajos Bene said the case was "unfounded," not least because Hamed's case had received wide publicity at the time.
Hamed was released from prison last month and is in custody awaiting deportation to a third country. He has resident status in Cyprus.