Germany's domestic spy agency is to investigate Alternative for Germany (AfD) to see whether the anti-immigrant party's policies breach constitutional safeguards against extremism.

The BfV (Federal Office for the Protection of the Constitution) domestic intelligence chief Thomas Haldenwang says Germany's main opposition party was a "case to investigate," although the probe would fall short of full-blown surveillance of the AfD.

Germany's constitution contains strict protections against extremism, allowing for the close monitoring and even the outlawing of far-left or far-right parties.

The AfD surged into the national parliament in a 2017 election, drawing votes from mainstream parties by focusing on voters' concerns over immigration.

It is represented in all 16 of Germany's regional parliaments.

Haldenwang said the BfV was concerned by an increase in momentum among right-wing extremist groups in recent years.

He said the spy agency would pay closer attention to the AfD's youth wing and elements close to regional AfD leader Bjoern Hoecke.

AfD co-leader Alexander Gauland has condemned the announcement, saying they will take legal action against this decision.

WATCH: Our reporter in Berlin, Jessica Saltz, says that the launching of such an inquiry is an extremely rare measure: