If you are a third-country national family member of an EU or EEA citizen and have resided permanently and legally in Germany for a period of five years, you can apply for a permanent residence card from the immigration authority.