If you want to apply for a visa and/or residence permit for Spain and you are applying with your spouse, you will have to present a marriage certificate to prove your formal relationship.
This seems to be a straightforward requirement, but, as many things, it is not as simple as one would think or hope it to be.
The challenge: 3 months validity
The document you present at the Immigration Office in Spain or at the Consulate or Embassy in your home country cannot be more than 3 months old.
You might wonder, how can my marriage certificate be less than 3 months old when I got married 20 years ago?!
Well, you do not have to get divorced and get married again, no worries. What this means is just that the document you present has to be dated within the past 3 months. What document that is depends on where your marriage was registered and how that country manages the registry.
What to do: Get a recent document
For example, if you got married in a country where your marriage is registered in a civil registry, you ask that registry for an extract of the entry of your marriage certificate.
While your original marriage certificate will of course always carry the date of your wedding, this extract will be dated when issued.
Since the marriage certificate is a public document, one issued by a government institution, it has to be legalised in order to be used in Spain or at the Spanish Consulate or Embassy. The legalisation has to happen because Spain cannot know whether the document is real, since it cannot access the files of another country's registry and institutions. Depending on the country where the marriage certificate is issued, the legalisation is done with the Apostille.
Once the document is legalised, in case it is not originally issued in Spanish, it has to be translated by a sworn translator. We can assist you with this and provide a list of translators.
Spouses of EU Citizens
Note that, if you got married in an EU country, you can ask the respective institution for a multilingual EU marriage certificate that can be used in Spain without it having to be legalised or translated. This will save you a lot of time and money.
Finally, in case you are applying for a Residence Card for Family Members of EU Citizens, make sure to check if the marriage was registered in the country of origin of the EU spouse. Depending on the home country of the EU citizen this will be required and it may take some time.