I am a U.S. citizen, residing in Spain, who sold a property last summer in Washington DC. Where do I pay the capital gains tax? In the U.S. or in Spain? Or both (with a credit for tax paid to the country with the lower rate applied to the country with the higher rate)? And finally, do I also have to pay the capital gains tax to Washington DC? (Obviously, I am not a resident of DC).
As a US citizen you're taxed in the US on your worldwide income. You're also taxed in Spain. Check the tax treaty for specific conditions and avoiding double taxation, and what forms and how you should file in Spain. The US has the priority in this case since that's where the property is located.
Real estate is usually taxed by the jurisdiction in which it is located first. I.e.: even if you were not a US tax resident, you'd be taxed by the US for this transaction, but probably with higher taxation rates.
And yes, you're also taxed by DC, for the same reason, but for DC you may be taxed as a "non-resident". Check the DC laws, physical residency and tax residency may differ so it's not at all obvious. Tax treaties usually do not apply to State taxes, but not sure how DC is treated for tax treaties, you should probably consult with a Spanish tax professional (you may end up being double taxed due to the DC tax).