A German court on Friday ordered a temporary halt to plans by the domestic intelligence agency to spy on the far-right AfD party for posing a threat to democracy.

The Cologne administrative court ruled that the Federal Office for the Protection of the Constitution (BfV) had to await the outcome of a legal challenge brought by the AfD first.

German media reported earlier this week that the BfV had decided to classify the anti-Islam, anti-immigrant AfD as "a suspected case" of right-wing extremism.

The designation would allow BfV agents to monitor the party, but the decision was not officially communicated.

The AfD is challenging the classification in emergency proceedings and the court found that the BfV had "not taken sufficient care" to prevent the information from leaking to the press while the case is pending.

The publicity given to the planned surveillance had interfered "in an unacceptable manner" with the AfD's constitutionally enshrined right "to equal opportunities among political parties" in a key election year, the court said.

AfD co-leader Joerg Meuthen hailed the court's temporary suspension as "a great victory for us" and mocked Germany's secret services "for failing to keep a secret".

The BfV declined to comment.

The AfD has slammed the BfV's investigations against the party as politically motivated, designed to undermine its chances at the ballot box.

Germany is holding a general election on September 26, the first in over 15 years that won't feature Chancellor Angela Merkel.

Germans are also heading to the polls in regional elections this year, including March 14 votes in the states of Baden-Wuerttemberg and Rhineland-Palatinate.

The co-leader of the parliamentary group of the Alternative for Germany (AfD) far-right party Alexander Gauland leaves a press conference this week
The co-leader of the parliamentary group of the Alternative for Germany (AfD) far-right party Alexander Gauland leaves a press conference this week AFP / Tobias SCHWARZ

The BfV's decision to label the AfD a "suspected case" follows a two-year investigation into the party's links to extremists, including around 1,000 pages of evidence.

The move would allow intelligence agents to shadow the party, tap its communications and possibly use undercover informants.

However, AfD lawmakers as well as candidates standing in this year's national and regional polls would be excluded from the monitoring.

Founded in 2013, the Alternative for Germany party started out as an anti-euro outfit before capitalising on public anger over Merkel's 2015 decision to allow in a wave of refugees.

It took nearly 13 percent of the vote in the 2017 general election, allowing it to enter the national parliament where it became the largest opposition party.

But with concerns about the migrant influx waning and the coronavirus pandemic roiling Germany, the AfD has fallen out of the spotlight and seen its popularity slip.

The party has in the past courted controversy by calling for Germany to stop atoning for its World War II crimes.

Senior AfD figure Alexander Gauland once described the Nazi era as just "a speck of bird poo" on German history.

Gauland has also railed against the government's Covid-19 restrictions, accusing Merkel of running a "corona dictatorship".

The BfV already placed a radical fringe of the AfD known as The Wing under surveillance last year over associations with known neo-Nazis and suspicions of violating the constitution.

The faction, led by firebrand Bjoern Hoecke, dissolved itself last March but many of its 7,000 members remain active in the AfD.

The Wing's continued influence in the party was one of the reasons for the BfV's decision, according to Der Spiegel magazine.

The AfD's regional branches in Thuringia, Brandenburg, Saxony and Saxony-Anhalt have also been designated as "suspected cases" of right-wing extremism.