An American freelancer in Spain could, on paper, owe contributions to both countries on the same income. The social security agreement between them exists to prevent exactly that.
The United States charges self-employment tax, which funds Social Security and Medicare, on the net self-employment income of its citizens wherever they live. Spain requires anyone who works for themselves in Spain to register in its self-employed scheme and pay monthly contributions. Without an agreement, an American in Valencia would pay both.
Under the agreement between the two countries, a self-employed person is subject to the social security laws of the country where they reside. An American who lives in Spain and is self-employed is therefore covered by the Spanish system only, and that income is exempt from US self-employment tax.
The exemption is not automatic on the US return. It is supported by a certificate of coverage issued by the Spanish social security authority, stating that the person is covered in Spain. Your US preparer attaches or keeps it with the return each year.
Contributions paid in one country are not lost for the other. The agreement allows periods of coverage in both countries to be added together to meet the minimum needed for a pension, with each country then paying a benefit in proportion to the time contributed under its own system. Someone with ten years in the United States and fifteen in Spain can qualify in both.
How much each system pays, and how US rules treat a foreign pension, depend on the individual history and should be checked with each agency before making decisions that rely on them.
The agreement deals with social security only. Income tax is governed separately, by the tax treaty and by each country's own law. We do not prepare US returns, and the US side of this should be confirmed by whoever does.
The same question arises for everyone who has contributed elsewhere. Within the European Union, the European Economic Area and Switzerland, coordination rules assign a worker to one country's system at a time and add periods together for pension rights. The United Kingdom has a protocol with the European Union that continues the essentials after its departure. Spain also has bilateral agreements with many other countries, including most of Latin America, Canada, Australia and Japan.
The details differ: which benefits are covered, how periods are counted, whether a pension can be paid abroad. What is common to all is that the right system is proved with a certificate, and that it should be requested at the start and not when a contribution demand arrives from the other country.
Contributions to the Spanish self-employed scheme are set by bands of expected net income, declared at registration and adjustable during the year. After the year closes, the social security office compares the contributions paid with the net income actually declared to the tax agency, and either claims the difference or refunds it.
New registrants usually pay a reduced flat amount for the first twelve months. Contributions give access to public healthcare, sickness and parental benefits, and count towards a Spanish pension. They are a deductible expense of the activity.
Try it
We keep the books and file the returns for foreigners working in Spain, in English, for a fixed monthly fee.