BERLIN — A German court has ruled that a comedian’s comments calling a leading figure in the nationalist Alternative for Germany party a “Nazi slut” on a television show were satirical and thus protected speech.

The Hamburg state court on Wednesday rejected a complaint from Alice Weidel, who is co-leading the anti-immigration party’s campaign for September elections. She had contended that the comments by comedian Christian Ehring on April 27 were defamatory.

Ehring, commenting on a recent Weidel statement that political correctness belonged on the scrapheap of history, said on the satirical show Extra 3: “OK, out with political correctness, let’s all be incorrect — there the Nazi slut is right.”

Party spokesman Christian Lueth says the decision against “such an aggressive defamation” will be appealed.

Alice Weidel (front L) and Alexander Gauland (front R) celebrate their nomination as campaign leaders of Germany's right-wing populist Alternative for Germany (AfD) party for the next German general election, during the party congress at the Maritim Hotel in Cologne, western Germany, on April 23, 2017. (Odd ANDERSEN / AFP)

Alice Weidel (front L) and Alexander Gauland (front R) celebrate their nomination as campaign leaders of Germany’s right-wing populist Alternative for Germany (AfD) party for the next German general election, during the party congress at the Maritim Hotel in Cologne, western Germany, on April 23, 2017. (Odd ANDERSEN / AFP)

Copyright 2017 The Associated Press.