If you are an American living in Spain and you own a house, you may be able to deduct the interest expenses on your Schedule A just as if you were in the US.
Of course, once you’ve told the IRS you have a foreign mortgage, you may be required to pay taxes on any currency gains if you repay your mortgage and the US dollar has dropped relative to the Euro. The IRS thinks you cannot offset this against the capital gain you’d get from selling your property, which means you’d get taxed twice although you didn’t gain anything. This is obviously stupid and goes against several US Supreme Court rulings, but it’s you vs the IRS. Not fun.
(Here’s how it works: Say the US dollar is 1:1 with the Euro, and you buy a house with a 100% load for 100,000 Euros later sell it for 100,000. Say that the US dollar goes up to 2:1 (hey it could happen). So in US dollars your house is sold for a $50,000, so you have a $50,000 dollar capital loss. However, your loan was worth $100,000 and you paid it off for $50,000, so you have a $50,000 ordinary income. And guess what, the IRS thinks you can’t deduct one against the other. So you pay taxes on $50,000 that you never made.)
If you decide you don’t want to deduct the interest (because you have excess foreign tax credits and don’t need to pay any US taxes), you could be liable for 30% of the interest you paid the bank, because the IRS considers this an interest payment to a foreign person, and wants you to act as a tax collector.
Luckily, the US/Spain tax treaty allows for loans with a 5-year or longer term to be totally exempt from the 30% withholding. However, the catch is that you need claim the treaty benefit and file an 8833 in order to get it. The US government wants some documentation to show that the bank you are paying interest to is a Spanish entity and not some US company trying to dodge taxes, so the Spanish bank needs to give you a W-8BEN. (There is an exemption for “Marketable securities” that would allow you to get away with an government official document that includes the name and address of the bank. Are mortgages marketable securities? Maybe.)
Once you’ve covered your ass by filing an 8833, most likely you do not have to file a 1042-S, since the IRS states that: "withholding agents who are individuals are not required to report a payment […] if they are not making the payment as part of their trade of business and no withholding is required to be made on the payment”.
Of course, if you set up a Qualified Business Unit to avoid the phantom currency gains from above, you have to say that you ARE in a trade or business, so good luck with that. Bah!