BERLIN (AP) — A court in northern Germany ruled Thursday that a far-right lawmaker was unjustly chastised for repeatedly using a racist slur during parliamentary debate.

Nikolaus Kramer of the Alternative for Germany party was called to order by the speaker in the Mecklenburg-Western Pomerania state assembly last October for his use of the word.

The state’s Constitutional Court said that judges had upheld Kramer’s appeal against the measure because it had interfered with his parliamentary rights.

The court also said the term shouldn’t be considered derogatory in all cases, as it could “contribute to substantive debate” and could be used in a non-pejorative way, such as to talk about the word itself.

Kramer initially used the racial epithet in an exchange with another lawmaker, later saying he’d chosen the term on purpose “because I won’t be told what’s a slur here and what isn’t.”

Shortly afterward he used the N-word again, to refer to a fictitious African immigrant several times in a debate on Germany’s migrant policies, repeating it even after other lawmakers called him out.

Earlier this year, a German court ordered another Alternative for Germany lawmaker to pay 15,000 euros ($16,700) in damages to tennis star Boris Becker’s son for referring to him in a tweet that used the racist slur.