An off-duty policeman was racially abused in the street as he walked home, a court has heard.
South Wales Police PC Abukar Masum was called a "n*****" as returned home following a visit to a mosque.
Filip Adam Nowak accepted he had said the word but claimed it was used during a conversation with a friend he had been with, and was not directed at the person walking by.
But the 26-year-old was convicted following a trial at Swansea Magistrates Court.
The court heard the incident took place in Swansea just after 9pm on August 8 2019.
Giving evidence, Mr Masum said he was walking from the mosque on the corner of St Helen's Road and George Street when he passed two men outside the nearby medical surgery.
He said one of the men, Nowak, said the word "n*****" as he walked passed them.
The witness said at first he ignored the word and carried on - but when it was used again, he turned around and told the man he could not use that kind of language.
In response to questions from prosecutor Gareth Waite he said: "He [Nowak] said words to the effect - 'I can, because you are one - then he spelled it out'."
"I was quite upset after it. The fact that he thought it was acceptable to call me that."
He said that in his "professional judgement" the defendant had been intoxicated at the time.
The court heard that after the incident Mr Nowak used him mobile to call the police, and report what had happened.
The trial also heard evidence from two men who were leaving a martial arts class at the nearby YMCA centre at the time.
Both men told the court they had heard Nowak say "What's up n*****?" or "Alright n*****?" to Mr Masum.
The witnesses said they too challenged the defendant about his use of language, with one saying it seemed to him the defendant was "looking for a confrontation".
Giving evidence in his defence Nowak, of Carlton Terrace, Mount Pleasant, Swansea, admitted using the n-word but denied it had been directed to the passer-by.
He told the court he had been talking about social problems with his friend Ethan Wheeler, and during the course of the conversation the word was used - but he said he had not called Mr Masum by the word.
Nowak said he himself had been subject to much abuse from others including being called "hippy", a "dirty Muslim" and a "n*****", and that people discriminated against him "just because of the way I look".
He denied being a racist, and said he had tried to explain what had happened to Mr Masum on the street but "he was having none of it".
Nowak was convicted of causing racially aggravated alarm or distress by district judge Chris James. He will be sentenced on February 26, and was bailed to reappear at court on that date.