The man is one of the first people to be convicted of using social media to spread false information.
A Spanish police officer has been jailed for 15 months after falsely accusing a migrant of rape on Twitter.
The Civil Guard official was found guilty of violating fundamental rights and public freedoms and was also handed a fine of €1,620.
He is one of the first people in Spain to be handed a jail sentence for using social media to deliberately spread misinformation.
In 2019, the officer posted a graphic video on Twitter of a man beating a woman until she was unconscious.
He falsely claimed that the attacker was an "unaccompanied minor Moroccan migrant from Canet de Mar" in Catalonia and that he had "raped" the victim.
The footage -- which received over 21,900 views -- actually showed an assault in China.
He had uploaded the video just days after a woman in Canet de Mar was allegedly raped by two foreign minors from a reception centre.
Prosecutors say the man had previously published racist and xenophobic messages online and wanted to stir up hatred against migrants.
The accused deliberately shared the "shocking" video with a "clear disregard for the truth," they added.
"All this, with the aim of defaming unaccompanied minors from other countries in a general and unjust way."
As the police officer had no previous convictions and the prison sentence was less than two years, he is likely to avoid jail.
Spain's Civil Guard says they have also begun disciplinary proceedings after the trial in Barcelona
The man's Twitter account has been shut down, while the court has also ordered the defendant to take an anti-discrimination course.