US–Spain Totalization Agreement: Social Security When You Work in Spain

Working in Spain as an American? Which Social Security system you pay into, how the 5-year rule works, and what remote workers need.

By Lorenzo, Spain Expat Consulting · Last checked: December 2026

Social Security is the cost Americans forget when they plan a move to Spain. Spanish contributions are substantial, and without coordination you could pay into both systems. The US–Spain Totalization Agreement, in force since 1 April 1988, decides which one you pay.

Short answer: The basic rule is that you pay Social Security where you work. If a US employer sends you to Spain for five years or less, you stay in US Social Security and are exempt in Spain with a certificate of coverage. If you are hired in Spain, or sent for longer, you pay into Spain. Self-employed people generally pay where they live, with a five-year exception for transferred businesses. Years paid in either country can be combined to qualify for benefits.

Which system do you pay into?

Your situation

Pays into

Sent by a US employer for 5 years or less

US (with certificate of coverage)

Sent by a US employer for more than 5 years

Spain

Hired by a Spanish employer

Spain

Self-employed, transferring your business for 5 years or less

Country you came from

Self-employed, otherwise

Generally the country where you live

Sources: the SSA’s Spain agreement page, the SSA’s agreement overview and SSA operating instructions for Spain.

How does the five-year rule work?

The detached worker rule applies when an employee is sent by an employer in one country to work temporarily for the same employer or an affiliate in the other. According to SSA’s instructions, the assignment must be expected to last no longer than five years. If plans change, the employer can request, with your consent and before the five years end, an extension of up to one more year. For an affiliate in Spain, the US employer must have a section 3121(l) agreement in place.

What about remote workers on the Digital Nomad Visa?

This is the grey area. Spain’s Digital Nomad Visa requires proof of social security: either registration in Spain or a certificate from your home country where an agreement exists, according to the UGE’s FAQ. The detached worker rule was written for employees sent by their employer, not for people who choose to move and keep working remotely. Before you count on a US certificate, check with the SSA and with us. Read working remotely for a US company from Spain.

Unsure where you’ll pay? Book a consultation or WhatsApp Lorenzo.

Why it matters for the Beckham Law

The Beckham Law’s six-month application window normally starts with your Spanish Social Security registration. If you stay in US Social Security under the agreement, the reference point becomes the start of your work in Spain instead, which is easy to miss. See the six-month deadline and the Beckham Law for Americans.

How are benefits combined?

If you have not worked long enough in one country to qualify for a pension there, the agreement lets each country count your credits from the other. Each then pays a benefit based on the time worked in its system. This can matter if you spend part of your career in Spain.

Frequently asked questions

Who asks for the certificate of coverage?

For employees sent from the US, the employer usually requests it from the SSA. Keep a copy, because Spanish authorities and your Spanish entity will ask for it.

Does the agreement cover healthcare?

No. It covers Social Security taxes and benefits. Health cover in Spain is a separate question.

What if I’m on a Spanish contract with a US parent company?

A Spanish contract usually means Spanish Social Security, unless the detached worker conditions are met.

Can I keep my US credits growing while living in Spain?

Only if you remain covered by US Social Security under the agreement, for example as a detached worker.

Get the coverage right from day one

We check your situation against the agreement and the Beckham Law together. Book a Beckham Law consultation or WhatsApp Lorenzo.

This article is general information, not legal or tax advice. Fees, thresholds and procedures change, so check the official sources linked above or speak to us before you act.

Need help applying this information to your circumstances? Speak with Spain Expat Consulting about the assistance available for your next steps.