MUENSTER, Germany (Reuters) -A German high court on Monday ruled that domestic security services could continue to treat the far-right Alternative for Germany (AfD) as a potentially extremist party, meaning they retain the right to subject it to surveillance.

The Federal Office for the Protection of the Constitution (BfV), charged with protecting Germany's democratic order from extremist threats, has classified the AfD as potentially extreme since 2021.

The party, which continues to top polls in several eastern states that hold elections later this year, has come under increased scrutiny over allegedly racist remarks by its members and allegations that it harboured spies and agents for Russia and China in its midst.

The potentially extremist designation means the party can be covertly surveilled, including via wiretapping and recruited informants inside the party. A lower court in Cologne first rejected the party's challenge against this in 2022. Monday's ruling by a higher court in Muenster upholds that finding.

"The ruling confirms what we have been saying for years: the AfD is a far-right party that wants to weaken our democracy and the rule of law," said Felix Kolb, head of the anti-extremism advocacy group Campact in a statement.

(Reporting by Elke Ahlswede, writing by Thomas Escritt)

By Elke Ahlswede