'We have learnt from our history that rightwing extremism needs to be stopped,' Germany's foreign ministry says.